summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-03-02 09:12:47 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-05-09 18:59:51 -0700
commitbff938b9fe1629cbacb726509edfa2a3840b7207 (patch)
tree7086fe37f60519291ecb756e3e0621f517115da4
parentf293659d5a4024bda386305bb7ebeb4647c40934 (diff)
unvalidated indexes in _XkbReadGeomShapes() [CVE-2013-1997 3/15]
If the X server returns shape indexes outside the range of the number of shapes it told us to allocate, out of bounds memory access could occur. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
-rw-r--r--src/xkb/XKBGeom.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/xkb/XKBGeom.c b/src/xkb/XKBGeom.c
index 7594a3de..4ad21f85 100644
--- a/src/xkb/XKBGeom.c
+++ b/src/xkb/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;