Skip to content

Commit 18ae036

Browse files
committed
hidapi/linux: fixed crash if uevent info isn't available
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
1 parent 9796ccb commit 18ae036

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/hidapi/linux/hid.c

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

0 commit comments

Comments
 (0)