projects
/
profile
/
ivi
/
weston-ivi-shell.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
67072d0
)
compositor-wayland: avoid possible NULL deref in handle_keymap
author
U. Artie Eoff
<ullysses.a.eoff@intel.com>
Tue, 6 May 2014 21:50:03 +0000
(14:50 -0700)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Tue, 6 May 2014 22:41:02 +0000
(15:41 -0700)
If data is NULL, then we jumped to error which attempts to
dereference data. Instead, just close(fd) and return when
data is NULL.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
src/compositor-wayland.c
patch
|
blob
|
history
diff --git
a/src/compositor-wayland.c
b/src/compositor-wayland.c
index
3cd308f
..
a08b71a
100644
(file)
--- a/
src/compositor-wayland.c
+++ b/
src/compositor-wayland.c
@@
-1424,8
+1424,10
@@
input_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format,
struct xkb_keymap *keymap;
char *map_str;
- if (!data)
- goto error;
+ if (!data) {
+ close(fd);
+ return;
+ }
if (format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);