diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-04-07 16:01:03 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2006-04-07 16:01:03 +0000 |
commit | d173f9d6561b223de0bf79603d303427da668a98 (patch) | |
tree | 5997cf5fdad33a8ffc490c1d8f9a23994d9acddf /src/xkbout.c | |
parent | bf3fad9eff30bba4587548303dd3d96f3da5d494 (diff) |
Coverity #979, #980, #981: Avoid potential NULL dereferences.
Diffstat (limited to 'src/xkbout.c')
-rw-r--r-- | src/xkbout.c | 12 |
1 files changed, 6 insertions, 6 deletions
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_types<XkbNumRequiredTypes) { _XkbLibError(_XkbErrMissingReqTypes,"XkbWriteXKBKeyTypes",0); return 0; @@ -311,11 +311,11 @@ XkbSymInterpretPtr interp; XkbDescPtr xkb; xkb= result->xkb; - 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", |