summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-05-04 15:34:31 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-05-04 15:37:36 -0700
commit130af2bc02090ee2526adb2f9803fc07019b8f1f (patch)
tree81abfc219e260d4378e1f81a030bfc5f69b70d2f
parentc987ef04bea345d5810e60cf6c53b747ddbe910e (diff)
XKB: XkbComputeSectionBounds: Check correct bounds in default switch-case
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> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/xkb/XKBGeom.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/xkb/XKBGeom.c b/src/xkb/XKBGeom.c
index 383e0de2..7594a3de 100644
--- a/src/xkb/XKBGeom.c
+++ b/src/xkb/XKBGeom.c
@@ -146,7 +146,7 @@ register int i;
XkbShapePtr shape;
XkbRowPtr row;
XkbDoodadPtr doodad;
-XkbBoundsPtr bounds,rbounds=NULL;
+XkbBoundsPtr bounds,rbounds;
if ((!geom)||(!section))
return False;
@@ -185,6 +185,7 @@ XkbBoundsPtr bounds,rbounds=NULL;
default:
tbounds.x1= tbounds.x2= doodad->any.left;
tbounds.y1= tbounds.y2= doodad->any.top;
+ rbounds= &tbounds;
break;
}
_XkbCheckBounds(bounds,rbounds->x1,rbounds->y1);