mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-05 16:50:29 +01:00
tablet: fix potential null-pointer dereference
Found by coverity Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
a6b43386d6
commit
6920a42fd4
1 changed files with 5 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue