mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-30 06:25:25 +03:00
[PATCH] prevent udevd crash if DEVPATH is not set
Just move the event straight to the exec list and don't try to compare a NULL pointer.
This commit is contained in:
parent
4bee999405
commit
80513ea38f
9
udevd.c
9
udevd.c
@ -153,9 +153,14 @@ static void udev_run(struct hotplug_msg *msg)
|
||||
static struct hotplug_msg *running_with_devpath(struct hotplug_msg *msg)
|
||||
{
|
||||
struct hotplug_msg *loop_msg;
|
||||
list_for_each_entry(loop_msg, &running_list, list)
|
||||
if (strncmp(loop_msg->devpath, msg->devpath, sizeof(loop_msg->devpath)) == 0)
|
||||
list_for_each_entry(loop_msg, &running_list, list) {
|
||||
if (loop_msg->devpath == NULL || msg->devpath == NULL)
|
||||
continue;
|
||||
|
||||
if (strcmp(loop_msg->devpath, msg->devpath) == 0)
|
||||
return loop_msg;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user