[PATCH 04/15] xkb: Fix NULL pointer dereference

Pauli Nieminen ext-pauli.nieminen at nokia.com
Tue Jul 27 05:09:45 PDT 2010


xkb->names is dereferenced in else path too.

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

diff --git a/xkb/xkmread.c b/xkb/xkmread.c
index 9eb8601..b564195 100644
--- a/xkb/xkmread.c
+++ b/xkb/xkmread.c
@@ -686,7 +686,11 @@ int			nRead=0;
 	    if ((tmp=XkmGetCountedString(file,buf,100))<1)
 		return -1;
 	    nRead+= tmp;
-	    if ((buf[0]!='\0')&&(xkb->names)) {
+
+	    if (!xkb->names)
+		    continue;
+
+	    if (buf[0]!='\0') {
 		Atom name;
 		name= XkbInternAtom(buf,0);
 		xkb->names->groups[i]= name;
-- 
1.6.3.3



More information about the xorg-devel mailing list