1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

udevadm: fix segfault

Fixes #11416.
This commit is contained in:
Yu Watanabe 2019-01-14 06:34:15 +09:00
parent 227bcd91b4
commit 0eba88dc9f

View File

@ -144,11 +144,11 @@ static int parse_argv(int argc, char *argv[]) {
slash = strchr(optarg, '/');
if (slash) {
devtype = strdup(devtype + 1);
devtype = strdup(slash + 1);
if (!devtype)
return -ENOMEM;
subsystem = strndup(optarg, devtype - optarg);
subsystem = strndup(optarg, slash - optarg);
} else
subsystem = strdup(optarg);