Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fca58f4b authored by Tomasz Kondel's avatar Tomasz Kondel Committed by JP Abgrall
Browse files

Fix segfault in get_character_device_symlinks()

A segmentation fault will occur when strchr function returns NULL.

Change-Id: I76076acfff16056179bf24dff5df9f81d9a45125
parent c325535d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -458,7 +458,7 @@ static char **get_character_device_symlinks(struct uevent *uevent)

    /* skip "/devices/platform/<driver>" */
    parent = strchr(uevent->path + pdev->path_len, '/');
    if (!*parent)
    if (!parent)
        goto err;

    if (!strncmp(parent, "/usb", 4)) {