summaryrefslogtreecommitdiff
path: root/src/xkb/XKBGetMap.c
diff options
context:
space:
mode:
authorDaniel Stone <daniels@endtroducing.localdomain>2006-04-09 22:22:03 +0300
committerDaniel Stone <daniels@endtroducing.localdomain>2006-04-09 22:22:03 +0300
commit7672bf93bc1200905461aeb0a2dc2c2696410b93 (patch)
tree89d17313c705f9539e2a353601dbe4e74740f7ce /src/xkb/XKBGetMap.c
parentcfcafbe48d22d9a0cd50eb9454ce0ff88f0129d3 (diff)
Coverity #203, #204: Fix potential NULL dereferences.
Diffstat (limited to 'src/xkb/XKBGetMap.c')
-rw-r--r--src/xkb/XKBGetMap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/xkb/XKBGetMap.c b/src/xkb/XKBGetMap.c
index 0e97083..777f7cc 100644
--- a/src/xkb/XKBGetMap.c
+++ b/src/xkb/XKBGetMap.c
@@ -718,7 +718,10 @@ XkbGetKeyExplicitComponents( Display * dpy,
if ((num>0)&&(first>=xkb->min_key_code)&&(first+num<=xkb->max_key_code))
bzero(&xkb->server->explicit[first],num);
}
- status= _XkbHandleGetMapReply(dpy, xkb);
+ if (xkb)
+ status= _XkbHandleGetMapReply(dpy, xkb);
+ else
+ status = BadMatch;
UnlockDisplay(dpy);
SyncHandle();
@@ -747,7 +750,10 @@ XkbGetKeyModifierMap(Display *dpy,unsigned first,unsigned num,XkbDescPtr xkb)
if ((num>0)&&(first>=xkb->min_key_code)&&(first+num<=xkb->max_key_code))
bzero(&xkb->map->modmap[first],num);
}
- status= _XkbHandleGetMapReply(dpy, xkb);
+ if (xkb)
+ status= _XkbHandleGetMapReply(dpy, xkb);
+ else
+ status = BadMatch;
UnlockDisplay(dpy);
SyncHandle();