diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-12-19 12:18:27 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-12-19 12:18:27 +0100 |
commit | 8d6a4a9b7bfabcf949ec80f552bd1f0707bf8c63 (patch) | |
tree | 63a72a6bbe88d32d866051cc4d07a4e955e63f38 /nx-X11 | |
parent | 989398afe84d6ceab891926d59aceb8aa1067785 (diff) | |
parent | 44c59e12dc3fb509d3d237cbc782cc44dfa30f4e (diff) | |
download | nx-libs-8d6a4a9b7bfabcf949ec80f552bd1f0707bf8c63.tar.gz nx-libs-8d6a4a9b7bfabcf949ec80f552bd1f0707bf8c63.tar.bz2 nx-libs-8d6a4a9b7bfabcf949ec80f552bd1f0707bf8c63.zip |
Merge branch 'uli42-pr/fix_uninit' into 3.6.x
Attributes GH PR #752: https://github.com/ArcticaProject/nx-libs/pull/752
Diffstat (limited to 'nx-X11')
-rw-r--r-- | nx-X11/programs/Xserver/dix/dispatch.c | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/xkb/xkb.c | 18 |
2 files changed, 14 insertions, 6 deletions
diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 3c791465e..5c4e54c73 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -3716,7 +3716,7 @@ ClientPtr NextAvailableClient(void * ospriv) i = nextFreeClientID; if (i == MAXCLIENTS) return (ClientPtr)NULL; - clients[i] = client = (ClientPtr)malloc(totalClientSize); + clients[i] = client = (ClientPtr)calloc(1,totalClientSize); if (!client) return (ClientPtr)NULL; InitClient(client, i, ospriv); diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index e11d7e26b..8d3fc6108 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -1185,7 +1185,7 @@ XkbSizeVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep) rep->totalVModMapKeys= 0; return 0; } - for (nRtrn=i=0;i<rep->nVModMapKeys-1;i++) { + for (nRtrn=i=0;i<rep->nVModMapKeys;i++) { if (xkb->server->vmodmap[i+rep->firstVModMapKey]!=0) nRtrn++; } @@ -3783,7 +3783,7 @@ ProcXkbSetNames(ClientPtr client) static char * XkbWriteCountedString(char *wire,char *str,Bool swap) { -CARD16 len,*pLen; +CARD16 len,*pLen, paddedLen; len= (str?strlen(str):0); pLen= (CARD16 *)wire; @@ -3791,8 +3791,9 @@ CARD16 len,*pLen; if (swap) { swaps(pLen); } - memcpy(&wire[2],str,len); - wire+= ((2+len+3)/4)*4; + paddedLen= pad_to_int32(sizeof(len)+len)-sizeof(len); + strncpy(&wire[sizeof(len)],str,paddedLen); + wire+= sizeof(len)+paddedLen; return wire; } @@ -3903,6 +3904,7 @@ xkbShapeWireDesc * shapeWire; if (shape->approx!=NULL) shapeWire->approxNdx= XkbOutlineIndex(shape,shape->approx); else shapeWire->approxNdx= XkbNoShape; + shapeWire->pad= 0; if (swap) { swapl(&shapeWire->name); } @@ -3914,6 +3916,7 @@ xkbShapeWireDesc * shapeWire; olWire= (xkbOutlineWireDesc *)wire; olWire->nPoints= ol->num_points; olWire->cornerRadius= ol->corner_radius; + olWire->pad= 0; wire= (char *)&olWire[1]; ptWire= (xkbPointWireDesc *)wire; for (p=0,pt=ol->points;p<ol->num_points;p++,pt++) { @@ -4023,6 +4026,8 @@ xkbOverlayWireDesc * olWire; olWire= (xkbOverlayWireDesc *)wire; olWire->name= ol->name; olWire->nRows= ol->num_rows; + olWire->pad1= 0; + olWire->pad2= 0; if (swap) { swapl(&olWire->name); } @@ -4034,6 +4039,7 @@ xkbOverlayWireDesc * olWire; rowWire= (xkbOverlayRowWireDesc *)wire; rowWire->rowUnder= row->row_under; rowWire->nKeys= row->num_keys; + rowWire->pad1= 0; wire= (char *)&rowWire[1]; for (k=0,key=row->keys;k<row->num_keys;k++,key++) { xkbOverlayKeyWireDesc * keyWire; @@ -5128,7 +5134,7 @@ ProcXkbGetKbdByName(ClientPtr client) mrep.present = 0; mrep.totalSyms = mrep.totalActs = mrep.totalKeyBehaviors= mrep.totalKeyExplicit= - mrep.totalModMapKeys= 0; + mrep.totalModMapKeys= mrep.totalVModMapKeys= 0; if (rep.reported&(XkbGBN_TypesMask|XkbGBN_ClientSymbolsMask)) { mrep.present|= XkbKeyTypesMask; mrep.firstType = 0; @@ -5154,6 +5160,8 @@ ProcXkbGetKbdByName(ClientPtr client) mrep.firstKeyExplicit = finfo.xkb->min_key_code; mrep.nKeyActs = mrep.nKeyBehaviors = mrep.nKeyExplicit = XkbNumKeys(finfo.xkb); + mrep.firstVModMapKey= finfo.xkb->min_key_code; + mrep.nVModMapKeys= XkbNumKeys(finfo.xkb); } else { mrep.virtualMods= 0; |