projects
/
platform
/
upstream
/
libinput.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c41c6b
)
Don't access event buffer after realloc
author
Peter Hutterer
<peter.hutterer@who-t.net>
Tue, 24 Dec 2013 03:46:20 +0000
(13:46 +1000)
committer
Jonas Ådahl
<jadahl@gmail.com>
Tue, 7 Jan 2014 20:27:30 +0000
(21:27 +0100)
realloc() may free the original event buffer, don't access it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/libinput.c
patch
|
blob
|
history
diff --git
a/src/libinput.c
b/src/libinput.c
index
989fd8c
..
95976f7
100644
(file)
--- a/
src/libinput.c
+++ b/
src/libinput.c
@@
-887,7
+887,7
@@
libinput_post_event(struct libinput *libinput,
move_len = libinput->events_len - libinput->events_out;
new_out = events_len - move_len;
memmove(events + new_out,
-
libinput->
events + libinput->events_out,
+ events + libinput->events_out,
move_len * sizeof *events);
libinput->events_out = new_out;
}