diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2004-11-19 03:49:13 +0100 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 22:30:27 -0700 |
commit | 80513ea38f66855fe9232d6eab3ab9469c379cad (patch) | |
tree | ebda6891705450e1499e96180cf8075103cd059c | |
parent | 4bee99940511a0e5ea5a3352ba2e8c0c97580e25 (diff) |
[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.
-rw-r--r-- | udevd.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; } |