From d173f9d6561b223de0bf79603d303427da668a98 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 7 Apr 2006 16:01:03 +0000 Subject: Coverity #979, #980, #981: Avoid potential NULL dereferences. --- ChangeLog | 2 +- src/xkbout.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 467de34..27880d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,7 @@ Fix signed vs unsigned char hilarity. (Bill Crawford) * src/xkbout.c: - Coverity #982: Fix potential NULL dereference. + Coverity #979, 980, 981, 982: Fix potential NULL dereferences. 2006-03-27 Daniel Stone diff --git a/src/xkbout.c b/src/xkbout.c index 7f8c8b5..5a2e4e1 100644 --- a/src/xkbout.c +++ b/src/xkbout.c @@ -135,11 +135,11 @@ Display * dpy; char * alternate; xkb= result->xkb; - dpy= xkb->dpy; - if ((!xkb)||(!xkb->names)||(!xkb->names->keys)) { + if ((!xkb)||(!xkb->names)||(!xkb->names->keys)||(!xkb->dpy)) { _XkbLibError(_XkbErrMissingNames,"XkbWriteXKBKeycodes",0); return False; } + dpy= xkb->dpy; kcName= xkb->names->keycodes; if (kcName!=None) fprintf(file,"xkb_keycodes \"%s\" {\n", @@ -199,11 +199,11 @@ XkbKTMapEntryPtr entry; XkbDescPtr xkb; xkb= result->xkb; - dpy= xkb->dpy; - if ((!xkb)||(!xkb->map)||(!xkb->map->types)) { + if ((!xkb)||(!xkb->map)||(!xkb->map->types)||(!xkb->dpy)) { _XkbLibError(_XkbErrMissingTypes,"XkbWriteXKBKeyTypes",0); return False; } + dpy= xkb->dpy; if (xkb->map->num_typesxkb; - dpy= xkb->dpy; - if ((!xkb)||(!xkb->compat)||(!xkb->compat->sym_interpret)) { + if ((!xkb)||(!xkb->compat)||(!xkb->compat->sym_interpret)||(!xkb->dpy)) { _XkbLibError(_XkbErrMissingCompatMap,"XkbWriteXKBCompatMap",0); return False; } + dpy= xkb->dpy; if ((xkb->names==NULL)||(xkb->names->compat==None)) fprintf(file,"xkb_compatibility {\n\n"); else fprintf(file,"xkb_compatibility \"%s\" {\n\n", -- cgit v1.2.3