summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-01-22 18:08:44 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-01-22 18:08:44 +1000
commit6920a42fd4ec8dfa633ef5bc1865f994afc63693 (patch)
treedc1f19779a53dbfb7419ccb7e61c99e921f72916 /src
parenta6b43386d6bbd196ee5357d26d5e338a26d8c8c2 (diff)
tablet: fix potential null-pointer dereference
Found by coverity Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/evdev-tablet.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index ae205501..e684055b 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -875,6 +875,8 @@ tablet_get_tool(struct tablet_dispatch *tablet,
const struct input_absinfo *pressure;
tool = zalloc(sizeof *tool);
+ if (!tool)
+ return NULL;
*tool = (struct libinput_tablet_tool) {
.type = type,
.serial = serial,
@@ -1295,6 +1297,9 @@ tablet_flush(struct tablet_dispatch *tablet,
tablet->current_tool_id,
tablet->current_tool_serial);
+ if (!tool)
+ return; /* OOM */
+
if (tool->type == LIBINPUT_TABLET_TOOL_TYPE_MOUSE ||
tool->type == LIBINPUT_TABLET_TOOL_TYPE_LENS)
tablet_update_proximity_state(tablet, device, tool);