projects
/
platform
/
upstream
/
weston.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ca59d3
)
evdev: prevent unterminated device name
author
Peter Hutterer
<peter.hutterer@who-t.net>
Wed, 7 Aug 2013 01:04:41 +0000
(11:04 +1000)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Thu, 8 Aug 2013 20:58:27 +0000
(13:58 -0700)
The kernel copies up to sizeof(devname) bytes but doesn't null-terminate the
string if the device name exceeds the size of the supplied buffer.
src/evdev.c
patch
|
blob
|
history
diff --git
a/src/evdev.c
b/src/evdev.c
index
fc5004c
..
27296f8
100644
(file)
--- a/
src/evdev.c
+++ b/
src/evdev.c
@@
-575,6
+575,7
@@
evdev_device_create(struct weston_seat *seat, const char *path, int device_fd)
device->fd = device_fd;
ioctl(device->fd, EVIOCGNAME(sizeof(devname)), devname);
+ devname[sizeof(devname) - 1] = '\0';
device->devname = strdup(devname);
if (!evdev_handle_device(device)) {