diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-04 11:34:53 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-04 11:34:53 -0700 |
commit | 4024091678ea07e0d898b798df9b29f3bf68eb08 (patch) | |
tree | eaa2b15aa0fd1e3eec9f01cf490df9fc78becd4e | |
parent | 626e5e34be55b7cf734d745bd40a7ee3359029f8 (diff) |
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>
-rw-r--r-- | src/xkb/XKBGeom.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xkb/XKBGeom.c b/src/xkb/XKBGeom.c index e9e36d0c..2365f480 100644 --- a/src/xkb/XKBGeom.c +++ b/src/xkb/XKBGeom.c @@ -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); |