XKB: Avoid a possible NULL dereference

XKBGeom.c:191:25: warning: Access to field 'x1' results in a dereference of a null pointer (loaded from variable 'rbounds')
        _XkbCheckBounds(bounds,rbounds->x1,rbounds->y1);
                               ^~~~~~~

Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston 2011-05-04 11:34:53 -07:00
parent 626e5e34be
commit 4024091678

View file

@ -147,7 +147,7 @@ register int i;
XkbShapePtr shape;
XkbRowPtr row;
XkbDoodadPtr doodad;
XkbBoundsPtr bounds,rbounds=NULL;
XkbBoundsPtr bounds,rbounds;
if ((!geom)||(!section))
return False;
@ -186,7 +186,7 @@ XkbBoundsPtr bounds,rbounds=NULL;
default:
tbounds.x1= tbounds.x2= doodad->any.left;
tbounds.y1= tbounds.y2= doodad->any.top;
break;
continue;
}
_XkbCheckBounds(bounds,rbounds->x1,rbounds->y1);
_XkbCheckBounds(bounds,rbounds->x2,rbounds->y2);