Merge pull request #11417 from yuwata/fix-11416

udevadm: fix segfault
This commit is contained in:
Michael Biebl
2019-01-14 02:39:11 +01:00
committed by GitHub
+2 -2
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);