summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-11-17 15:24:47 +0100
committerKay Sievers <kay.sievers@vrfy.org>2008-11-17 15:24:47 +0100
commit5375c80eba10d8813a123429b655942fd7073209 (patch)
tree849e05a2586bbb5d674cb47db431ca653a3a6023 /udev
parentc969f8806272b9fec50eb3325727cd012ce8dd1c (diff)
fix $links substitution for devices without any link
Reported-by: Michel Hermier <michel.hermier@gmail.com>
Diffstat (limited to 'udev')
-rw-r--r--udev/udev-event.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/udev/udev-event.c b/udev/udev-event.c
index 27bb5eb79a..32b45e9bac 100644
--- a/udev/udev-event.c
+++ b/udev/udev-event.c
@@ -231,8 +231,9 @@ found:
break;
case SUBST_DRIVER:
if (event->dev_parent != NULL) {
- const char *driver = udev_device_get_driver(event->dev_parent);
+ const char *driver;
+ driver = udev_device_get_driver(event->dev_parent);
if (driver == NULL)
break;
util_strlcat(string, driver, maxsize);
@@ -398,6 +399,8 @@ found:
struct udev_list_entry *list_entry;
list_entry = udev_device_get_devlinks_list_entry(dev);
+ if (list_entry == NULL)
+ break;
util_strlcat(string, &udev_list_entry_get_name(list_entry)[devlen], maxsize);
udev_list_entry_foreach(list_entry, udev_list_entry_get_next(list_entry)) {
util_strlcat(string, " ", maxsize);
@@ -426,6 +429,8 @@ found:
if (list_entry == NULL)
break;
value = udev_list_entry_get_value(list_entry);
+ if (value == NULL)
+ break;
dbg(event->udev, "substitute env '%s=%s'\n", attr, value);
util_strlcat(string, value, maxsize);
break;