[PATCH v2 7/7] xkb: Fix possible NULL pointer dereference

Pauli Nieminen ext-pauli.nieminen at nokia.com
Wed Jul 28 12:47:07 PDT 2010


keybd have to be checked in case it is NULL when the error message is
printed.

fixes:
Variable "keybd" tracked as NULL was dereferenced.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---

Cleanup externous hunk from
[PATCH 11/15] xkb: Fix possible NULL pointer dereference

I changed the patch to jsut do the NULL check for error message that is
only place that analiser is complaining about.

 xkb/ddxLoad.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index 5e6ab87..50e369b 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -349,7 +349,7 @@ unsigned	missing;
 	(names->compat==NULL)&&(names->symbols==NULL)&&
 	(names->geometry==NULL)) {
         LogMessage(X_ERROR, "XKB: No components provided for device %s\n",
-                   keybd->name ? keybd->name : "(unnamed keyboard)");
+                   keybd && keybd->name ? keybd->name : "(unnamed keyboard)");
         return 0;
     }
     else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need,
-- 
1.6.3.3



More information about the xorg-devel mailing list