Unverified Commit 8d6a4a9b authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/fix_uninit' into 3.6.x

parents 989398af 44c59e12
...@@ -3716,7 +3716,7 @@ ClientPtr NextAvailableClient(void * ospriv) ...@@ -3716,7 +3716,7 @@ ClientPtr NextAvailableClient(void * ospriv)
i = nextFreeClientID; i = nextFreeClientID;
if (i == MAXCLIENTS) if (i == MAXCLIENTS)
return (ClientPtr)NULL; return (ClientPtr)NULL;
clients[i] = client = (ClientPtr)malloc(totalClientSize); clients[i] = client = (ClientPtr)calloc(1,totalClientSize);
if (!client) if (!client)
return (ClientPtr)NULL; return (ClientPtr)NULL;
InitClient(client, i, ospriv); InitClient(client, i, ospriv);
......
...@@ -1185,7 +1185,7 @@ XkbSizeVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep) ...@@ -1185,7 +1185,7 @@ XkbSizeVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep)
rep->totalVModMapKeys= 0; rep->totalVModMapKeys= 0;
return 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) if (xkb->server->vmodmap[i+rep->firstVModMapKey]!=0)
nRtrn++; nRtrn++;
} }
...@@ -3783,7 +3783,7 @@ ProcXkbSetNames(ClientPtr client) ...@@ -3783,7 +3783,7 @@ ProcXkbSetNames(ClientPtr client)
static char * static char *
XkbWriteCountedString(char *wire,char *str,Bool swap) XkbWriteCountedString(char *wire,char *str,Bool swap)
{ {
CARD16 len,*pLen; CARD16 len,*pLen, paddedLen;
len= (str?strlen(str):0); len= (str?strlen(str):0);
pLen= (CARD16 *)wire; pLen= (CARD16 *)wire;
...@@ -3791,8 +3791,9 @@ CARD16 len,*pLen; ...@@ -3791,8 +3791,9 @@ CARD16 len,*pLen;
if (swap) { if (swap) {
swaps(pLen); swaps(pLen);
} }
memcpy(&wire[2],str,len); paddedLen= pad_to_int32(sizeof(len)+len)-sizeof(len);
wire+= ((2+len+3)/4)*4; strncpy(&wire[sizeof(len)],str,paddedLen);
wire+= sizeof(len)+paddedLen;
return wire; return wire;
} }
...@@ -3903,6 +3904,7 @@ xkbShapeWireDesc * shapeWire; ...@@ -3903,6 +3904,7 @@ xkbShapeWireDesc * shapeWire;
if (shape->approx!=NULL) if (shape->approx!=NULL)
shapeWire->approxNdx= XkbOutlineIndex(shape,shape->approx); shapeWire->approxNdx= XkbOutlineIndex(shape,shape->approx);
else shapeWire->approxNdx= XkbNoShape; else shapeWire->approxNdx= XkbNoShape;
shapeWire->pad= 0;
if (swap) { if (swap) {
swapl(&shapeWire->name); swapl(&shapeWire->name);
} }
...@@ -3914,6 +3916,7 @@ xkbShapeWireDesc * shapeWire; ...@@ -3914,6 +3916,7 @@ xkbShapeWireDesc * shapeWire;
olWire= (xkbOutlineWireDesc *)wire; olWire= (xkbOutlineWireDesc *)wire;
olWire->nPoints= ol->num_points; olWire->nPoints= ol->num_points;
olWire->cornerRadius= ol->corner_radius; olWire->cornerRadius= ol->corner_radius;
olWire->pad= 0;
wire= (char *)&olWire[1]; wire= (char *)&olWire[1];
ptWire= (xkbPointWireDesc *)wire; ptWire= (xkbPointWireDesc *)wire;
for (p=0,pt=ol->points;p<ol->num_points;p++,pt++) { for (p=0,pt=ol->points;p<ol->num_points;p++,pt++) {
...@@ -4023,6 +4026,8 @@ xkbOverlayWireDesc * olWire; ...@@ -4023,6 +4026,8 @@ xkbOverlayWireDesc * olWire;
olWire= (xkbOverlayWireDesc *)wire; olWire= (xkbOverlayWireDesc *)wire;
olWire->name= ol->name; olWire->name= ol->name;
olWire->nRows= ol->num_rows; olWire->nRows= ol->num_rows;
olWire->pad1= 0;
olWire->pad2= 0;
if (swap) { if (swap) {
swapl(&olWire->name); swapl(&olWire->name);
} }
...@@ -4034,6 +4039,7 @@ xkbOverlayWireDesc * olWire; ...@@ -4034,6 +4039,7 @@ xkbOverlayWireDesc * olWire;
rowWire= (xkbOverlayRowWireDesc *)wire; rowWire= (xkbOverlayRowWireDesc *)wire;
rowWire->rowUnder= row->row_under; rowWire->rowUnder= row->row_under;
rowWire->nKeys= row->num_keys; rowWire->nKeys= row->num_keys;
rowWire->pad1= 0;
wire= (char *)&rowWire[1]; wire= (char *)&rowWire[1];
for (k=0,key=row->keys;k<row->num_keys;k++,key++) { for (k=0,key=row->keys;k<row->num_keys;k++,key++) {
xkbOverlayKeyWireDesc * keyWire; xkbOverlayKeyWireDesc * keyWire;
...@@ -5128,7 +5134,7 @@ ProcXkbGetKbdByName(ClientPtr client) ...@@ -5128,7 +5134,7 @@ ProcXkbGetKbdByName(ClientPtr client)
mrep.present = 0; mrep.present = 0;
mrep.totalSyms = mrep.totalActs = mrep.totalSyms = mrep.totalActs =
mrep.totalKeyBehaviors= mrep.totalKeyExplicit= mrep.totalKeyBehaviors= mrep.totalKeyExplicit=
mrep.totalModMapKeys= 0; mrep.totalModMapKeys= mrep.totalVModMapKeys= 0;
if (rep.reported&(XkbGBN_TypesMask|XkbGBN_ClientSymbolsMask)) { if (rep.reported&(XkbGBN_TypesMask|XkbGBN_ClientSymbolsMask)) {
mrep.present|= XkbKeyTypesMask; mrep.present|= XkbKeyTypesMask;
mrep.firstType = 0; mrep.firstType = 0;
...@@ -5154,6 +5160,8 @@ ProcXkbGetKbdByName(ClientPtr client) ...@@ -5154,6 +5160,8 @@ ProcXkbGetKbdByName(ClientPtr client)
mrep.firstKeyExplicit = finfo.xkb->min_key_code; mrep.firstKeyExplicit = finfo.xkb->min_key_code;
mrep.nKeyActs = mrep.nKeyBehaviors = mrep.nKeyActs = mrep.nKeyBehaviors =
mrep.nKeyExplicit = XkbNumKeys(finfo.xkb); mrep.nKeyExplicit = XkbNumKeys(finfo.xkb);
mrep.firstVModMapKey= finfo.xkb->min_key_code;
mrep.nVModMapKeys= XkbNumKeys(finfo.xkb);
} }
else { else {
mrep.virtualMods= 0; mrep.virtualMods= 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment