1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00

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
commit 1c8e48f506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);