From 7efa7da59e27ad72e7f1b554f85804b82977cbef Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 4 May 2011 15:34:31 -0700 Subject: 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 Reviewed-by: Peter Hutterer Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/XKBGeom.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nx-X11/lib') diff --git a/nx-X11/lib/X11/XKBGeom.c b/nx-X11/lib/X11/XKBGeom.c index 39ed4bed7..2f34bea80 100644 --- a/nx-X11/lib/X11/XKBGeom.c +++ b/nx-X11/lib/X11/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); -- cgit v1.2.3