aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nx-X11/programs/Xserver/xkb/xkb.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c
index 67d7f2b95..8d3fc6108 100644
--- a/nx-X11/programs/Xserver/xkb/xkb.c
+++ b/nx-X11/programs/Xserver/xkb/xkb.c
@@ -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;