mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-28 11:55:23 +03:00
udev-event: check command is not empty before executing
This commit is contained in:
parent
e9343893f7
commit
dc8aec36a6
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user