aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/XKBGeom.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-10-13 14:02:51 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-10-13 14:02:51 +0200
commit133c91f732c6259fa9099100cd5b781d5b1cbfa1 (patch)
tree478aa88a8c42cbcb8221dd6680a16131556b49be /nx-X11/lib/X11/XKBGeom.c
parent051d521f6e20761ba6831cecd91883da960fa931 (diff)
parenta9f623f0a63372ca0705e8394fadf514dec55b1c (diff)
downloadnx-libs-133c91f732c6259fa9099100cd5b781d5b1cbfa1.tar.gz
nx-libs-133c91f732c6259fa9099100cd5b781d5b1cbfa1.tar.bz2
nx-libs-133c91f732c6259fa9099100cd5b781d5b1cbfa1.zip
Merge branch 'uli42-pr/libX11_debian_backports' into 3.6.x
Attributes GH PR #215: https://github.com/ArcticaProject/nx-libs/pull/215
Diffstat (limited to 'nx-X11/lib/X11/XKBGeom.c')
-rw-r--r--nx-X11/lib/X11/XKBGeom.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/nx-X11/lib/X11/XKBGeom.c b/nx-X11/lib/X11/XKBGeom.c
index 5ab51b682..1f9628bea 100644
--- a/nx-X11/lib/X11/XKBGeom.c
+++ b/nx-X11/lib/X11/XKBGeom.c
@@ -364,12 +364,16 @@ Status rtrn;
}
ol->num_points= olWire->nPoints;
}
- if (shapeWire->primaryNdx!=XkbNoShape)
+ if ((shapeWire->primaryNdx!=XkbNoShape) &&
+ (shapeWire->primaryNdx < shapeWire->nOutlines))
shape->primary= &shape->outlines[shapeWire->primaryNdx];
- else shape->primary= NULL;
- if (shapeWire->approxNdx!=XkbNoShape)
+ else
+ shape->primary= NULL;
+ if ((shapeWire->approxNdx!=XkbNoShape) &&
+ (shapeWire->approxNdx < shapeWire->nOutlines))
shape->approx= &shape->outlines[shapeWire->approxNdx];
- else shape->approx= NULL;
+ else
+ shape->approx= NULL;
XkbComputeShapeBounds(shape);
}
return Success;
@@ -615,6 +619,9 @@ XkbGeometryPtr geom;
if (status==Success)
status= _XkbReadGeomKeyAliases(&buf,geom,rep);
left= _XkbFreeReadBuffer(&buf);
+ if ((rep->baseColorNdx > geom->num_colors) ||
+ (rep->labelColorNdx > geom->num_colors))
+ status = BadLength;
if ((status!=Success) || left || buf.error) {
if (status==Success)
status= BadLength;