diff options
author | Peter Åstrand <astrand@cendio.se> | 2009-02-13 10:23:28 +0100 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2015-07-02 00:24:11 +0200 |
commit | d088698324d5e71cb93ccd429f084729ba07872c (patch) | |
tree | 770207f94a7e65c6fc1e48f659ebc77a2f0f8cae /nx-X11/programs/Xserver/xkb | |
parent | cf660f485eb478bcb7aaef3a538f2791e46662d9 (diff) | |
download | nx-libs-d088698324d5e71cb93ccd429f084729ba07872c.tar.gz nx-libs-d088698324d5e71cb93ccd429f084729ba07872c.tar.bz2 nx-libs-d088698324d5e71cb93ccd429f084729ba07872c.zip |
Backport: xserver: Avoid sending uninitialized padding data over the network
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'nx-X11/programs/Xserver/xkb')
-rw-r--r-- | nx-X11/programs/Xserver/xkb/xkb.c | 9 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/xkb/xkbEvents.c | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 778269f7c..1e4052914 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -192,6 +192,7 @@ ProcXkbUseExtension(ClientPtr client) stuff->wantedMajor,stuff->wantedMinor, XkbMajorVersion,XkbMinorVersion); } + memset(&rep, 0, sizeof(xkbUseExtensionReply)); rep.type = X_Reply; rep.supported = supported; rep.length = 0; @@ -1313,6 +1314,8 @@ char *desc,*start; start= desc= (char *)ALLOCATE_LOCAL(len); if (!start) return BadAlloc; + memset(start, 0, len); + if ( rep->nTypes>0 ) desc = XkbWriteKeyTypes(xkb,rep,desc,client); if ( rep->nKeySyms>0 ) @@ -2381,6 +2384,8 @@ ProcXkbSetMap(ClientPtr client) (xkb->max_key_code!=stuff->maxKeyCode)) { Status status; xkbNewKeyboardNotify nkn; + + memset(&nkn, 0, sizeof(xkbNewKeyboardNotify)); nkn.deviceID= nkn.oldDeviceID= dev->id; nkn.oldMinKeyCode= xkb->min_key_code; nkn.oldMaxKeyCode= xkb->max_key_code; @@ -3480,6 +3485,7 @@ ProcXkbGetNames(ClientPtr client) CHK_MASK_LEGAL(0x01,stuff->which,XkbAllNamesMask); xkb = dev->key->xkbInfo->desc; + memset(&rep, 0, sizeof(xkbGetNamesReply)); rep.type= X_Reply; rep.sequenceNumber= client->sequence; rep.length = 0; @@ -4939,6 +4945,7 @@ ProcXkbSetGeometry(ClientPtr client) nn.changed= XkbGeometryNameMask; XkbSendNamesNotify(dev,&nn); } + memset(&nkn, 0, sizeof(xkbNewKeyboardNotify)); nkn.deviceID= nkn.oldDeviceID= dev->id; nkn.minKeyCode= nkn.oldMinKeyCode= xkb->min_key_code; nkn.maxKeyCode= nkn.oldMaxKeyCode= xkb->max_key_code; @@ -4969,6 +4976,7 @@ ProcXkbPerClientFlags(ClientPtr client) CHK_MASK_MATCH(0x02,stuff->change,stuff->value); interest = XkbFindClientResource((DevicePtr)dev,client); + memset(&rep, 0, sizeof(xkbPerClientFlagsReply)); rep.type= X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -5463,6 +5471,7 @@ ProcXkbGetKbdByName(ClientPtr client) XkbFreeSrvLedInfo(old_sli); } + memset(&nkn, 0, sizeof(xkbNewKeyboardNotify)); nkn.deviceID= nkn.oldDeviceID= dev->id; nkn.minKeyCode= finfo.xkb->min_key_code; nkn.maxKeyCode= finfo.xkb->max_key_code; diff --git a/nx-X11/programs/Xserver/xkb/xkbEvents.c b/nx-X11/programs/Xserver/xkb/xkbEvents.c index 8305208a0..914e3e782 100644 --- a/nx-X11/programs/Xserver/xkb/xkbEvents.c +++ b/nx-X11/programs/Xserver/xkb/xkbEvents.c @@ -730,6 +730,7 @@ XkbSrvLedInfoPtr sli; } if (pChanges->map.changed) { xkbMapNotify mn; + memset(&mn, 0, sizeof(xkbMapNotify)); mn.changed= pChanges->map.changed; mn.firstType= pChanges->map.first_type; mn.nTypes= pChanges->map.num_types; @@ -751,6 +752,7 @@ XkbSrvLedInfoPtr sli; if ((pChanges->ctrls.changed_ctrls)|| (pChanges->ctrls.enabled_ctrls_changes)) { xkbControlsNotify cn; + memset(&cn, 0, sizeof(xkbControlsNotify)); cn.changedControls= pChanges->ctrls.changed_ctrls; cn.enabledControlChanges= pChanges->ctrls.enabled_ctrls_changes; cn.keycode= cause->kc; @@ -763,6 +765,7 @@ XkbSrvLedInfoPtr sli; xkbIndicatorNotify in; if (sli==NULL) sli= XkbFindSrvLedInfo(kbd,XkbDfltXIClass,XkbDfltXIId,0); + memset(&in, 0, sizeof(xkbIndicatorNotify)); in.state= sli->effectiveState; in.changed= pChanges->indicators.map_changes; XkbSendIndicatorNotify(kbd,XkbIndicatorMapNotify,&in); @@ -771,12 +774,14 @@ XkbSrvLedInfoPtr sli; xkbIndicatorNotify in; if (sli==NULL) sli= XkbFindSrvLedInfo(kbd,XkbDfltXIClass,XkbDfltXIId,0); + memset(&in, 0, sizeof(xkbIndicatorNotify)); in.state= sli->effectiveState; in.changed= pChanges->indicators.state_changes; XkbSendIndicatorNotify(kbd,XkbIndicatorStateNotify,&in); } if (pChanges->names.changed) { xkbNamesNotify nn; + memset(&nn, 0, sizeof(xkbNamesNotify)); nn.changed= pChanges->names.changed; nn.firstType= pChanges->names.first_type; nn.nTypes= pChanges->names.num_types; @@ -789,6 +794,7 @@ XkbSrvLedInfoPtr sli; } if ((pChanges->compat.changed_groups)||(pChanges->compat.num_si>0)) { xkbCompatMapNotify cmn; + memset(&cmn, 0, sizeof(xkbCompatMapNotify)); cmn.changedGroups= pChanges->compat.changed_groups; cmn.firstSI= pChanges->compat.first_si; cmn.nSI= pChanges->compat.num_si; |