Commit 3d35dfcf authored by Ted Felix's avatar Ted Felix Committed by Peter Hutterer
Browse files

xfree86: bail on misformed acpi strings (#73227)

If acpid sends a string in a format that we can't parse, bail out instead of
potentially dereferencing a NULL-pointer.

X.Org Bug 73227 <http://bugs.freedesktop.org/show_bug.cgi?id=73227

>
Signed-off-by: default avatarTed Felix <ted@tedfelix.com>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent fdc45158
......@@ -82,18 +82,21 @@ lnxACPIGetEventFromOs(int fd, pmEvent * events, int num)
video = strtok(ev, " ");
GFX = strtok(NULL, " ");
if (!(GFX = strtok(NULL, " ")))
return 0;
#if 0
ErrorF("GFX: %s\n", GFX);
#endif
notify = strtok(NULL, " ");
if (!(notify = strtok(NULL, " ")))
return 0;
notify_l = strtoul(notify, NULL, 16);
#if 0
ErrorF("notify: 0x%lx\n", notify_l);
#endif
data = strtok(NULL, " ");
if (!(data = strtok(NULL, " ")))
return 0;
data_l = strtoul(data, NULL, 16);
#if 0
ErrorF("data: 0x%lx\n", data_l);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment