Skip to content

Commit a88805e

Browse files
authored
hidraw: fixed crash if uevent info isn't available (#580)
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
1 parent b8ab253 commit a88805e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

linux/hid.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,11 @@ static int parse_uevent_info(const char *uevent, unsigned *bus_type,
512512
char **serial_number_utf8, char **product_name_utf8)
513513
{
514514
char tmp[1024];
515+
516+
if (!uevent) {
517+
return 0;
518+
}
519+
515520
size_t uevent_len = strlen(uevent);
516521
if (uevent_len > sizeof(tmp) - 1)
517522
uevent_len = sizeof(tmp) - 1;

0 commit comments

Comments
 (0)