summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-01-13 22:34:15 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-01-13 22:34:19 +0100
commit0eba88dc9f66aca023a89e2bf25f6bff49787145 (patch)
tree6b9a2b96c7eb8dbbba9be580fcc3ab8e89bf3932
parentman: fix reference (diff)
downloadsystemd-0eba88dc9f66aca023a89e2bf25f6bff49787145.tar.xz
systemd-0eba88dc9f66aca023a89e2bf25f6bff49787145.zip
udevadm: fix segfault
Fixes #11416.
-rw-r--r--src/udev/udevadm-monitor.c4
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);