diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-25 06:35:16 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-27 07:03:39 +0900 |
commit | dc8aec36a61ef32fa13d0f3823053488a8ec8ab1 (patch) | |
tree | bfbcf61b8d132031a6df6a6bd3fcf55d3993fee6 | |
parent | e9343893f790d8aac4d8013b2110fc5de6bc681a (diff) | |
download | systemd-dc8aec36a61ef32fa13d0f3823053488a8ec8ab1.tar.gz |
udev-event: check command is not empty before executing
-rw-r--r-- | src/udev/udev-event.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index 2125a6fa0d..125b4005b1 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -586,6 +586,8 @@ int udev_event_spawn(struct udev_event *event, pid_t pid; int r; + assert(event); + assert(event->dev); assert(result || ressize == 0); /* pipes from child to parent */ @@ -601,6 +603,11 @@ int udev_event_spawn(struct udev_event *event, if (!argv) return log_oom(); + if (isempty(argv[0])) { + log_error("Invalid command '%s'", cmd); + return -EINVAL; + } + /* allow programs in /usr/lib/udev/ to be called without the path */ if (!path_is_absolute(argv[0])) { char *program; |