diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-01-13 22:34:15 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-01-13 22:34:19 +0100 |
commit | 0eba88dc9f66aca023a89e2bf25f6bff49787145 (patch) | |
tree | 6b9a2b96c7eb8dbbba9be580fcc3ab8e89bf3932 | |
parent | man: fix reference (diff) | |
download | systemd-0eba88dc9f66aca023a89e2bf25f6bff49787145.tar.xz systemd-0eba88dc9f66aca023a89e2bf25f6bff49787145.zip |
udevadm: fix segfault
Fixes #11416.
-rw-r--r-- | src/udev/udevadm-monitor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/udev/udevadm-monitor.c b/src/udev/udevadm-monitor.c index f1b3e25cdd..3dde3f338a 100644 --- a/src/udev/udevadm-monitor.c +++ b/src/udev/udevadm-monitor.c @@ -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); |