diff options
author | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2004-08-07 19:22:01 +0000 |
---|---|---|
committer | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2004-08-07 19:22:01 +0000 |
commit | 40a8dac56de796db130b53dc1b01ea7421d0bf93 (patch) | |
tree | 81adbadc43dacebbcadbfd5a03a138c896795a83 | |
parent | 0f92f0f76b812a29bbb748e7588a7208be4c30e2 (diff) |
Check to see if array->data is NULL before we dereference it, instead ofrel-0-6-1lg3d-rel-0-7-0lg3d-baseXORG-6_8_1XORG-6_8_0XORG-6_7_99_904XORG-6_7_99_903XORG-6_7_99_902XORG-6_7_99_901XORG-6_7_99_2XORG-6_7_99_1lg3d-eventlg3d-dev-0-6-latestlg3d-dev-0-6-1-latestlg3d-dev-0-6-1-currentlg3d-dev-0-6-1lg3d
after. (Prevents segfault when array->data is initialized to NULL, but
array->length is not set to 0.)
Always initialize both data & length in ARRAYs.
-rw-r--r-- | xdmcp.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/xdm/xdmcp.c,v 1.2 2004/04/23 19:54:42 eich Exp $ */ +/* $XdotOrg: xc/programs/xdm/xdmcp.c,v 1.3 2004/05/24 19:05:01 eich Exp $ */ /* $Xorg: xdmcp.c,v 1.4 2001/02/09 02:05:41 xorgcvs Exp $ */ /* @@ -943,13 +943,20 @@ request_respond ( ARRAY8Ptr connectionAddress; Debug ("Request respond %d\n", length); + connectionTypes.length = 0; connectionTypes.data = 0; + connectionAddresses.length = 0; connectionAddresses.data = 0; + authenticationName.length = 0; authenticationName.data = 0; + authenticationData.length = 0; authenticationData.data = 0; + authorizationNames.length = 0; authorizationNames.data = 0; authorizationName.length = 0; + authorizationName.data = 0; authorizationData.length = 0; + authorizationData.data = 0; manufacturerDisplayID.data = 0; if (XdmcpReadCARD16 (&buffer, &displayNumber) && XdmcpReadARRAY16 (&buffer, &connectionTypes) && |