[PATCH libxkbfile 04/12] Don't dereference variable before NULL check

Pauli Nieminen ext-pauli.nieminen at nokia.com
Wed Jul 21 05:02:48 PDT 2010


Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---
 src/xkmout.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/xkmout.c b/src/xkmout.c
index 4f25e5d..391e1b5 100644
--- a/src/xkmout.c
+++ b/src/xkmout.c
@@ -701,7 +701,10 @@ unsigned		tmp,size= 0;
     dpy= xkb->dpy;
     size+= xkmPutCARD8(file,info->num_leds);
     size+= xkmPutPadding(file,3);
-    size+= xkmPutCARD32(file,xkb->indicators->phys_indicators);
+    if (xkb->indicators)
+	size+= xkmPutCARD32(file,xkb->indicators->phys_indicators);
+    else
+	size+= xkmPutCARD32(file,0);
     if (xkb->indicators!=NULL) {
 	for (i=0;i<XkbNumIndicators;i++) {
 	    XkbIndicatorMapPtr map= &xkb->indicators->maps[i];
-- 
1.6.3.3



More information about the xorg-devel mailing list