]> err.no Git - systemd/commitdiff
libudev: monitor - do not mangle DEVLINKS property
authorKay Sievers <kay.sievers@vrfy.org>
Wed, 15 Oct 2008 14:55:04 +0000 (16:55 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Wed, 15 Oct 2008 14:55:04 +0000 (16:55 +0200)
udev/lib/libudev-monitor.c

index ccfcd6afc518f6dc31a94d4c85a409879a409167..dd8dfac3233778743eb460183c2bc9255a138678 100644 (file)
@@ -320,9 +320,13 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito
                } else if (strncmp(key, "DEVNAME=", 8) == 0) {
                        udev_device_set_devnode(udev_device, &key[8]);
                } else if (strncmp(key, "DEVLINKS=", 9) == 0) {
-                       char *slink = &key[9];
-                       char *next = strchr(slink, ' ');
+                       char devlinks[UTIL_PATH_SIZE];
+                       char *slink;
+                       char *next;
 
+                       util_strlcpy(devlinks, &key[9], sizeof(devlinks));
+                       slink = devlinks;
+                       next = strchr(slink, ' ');
                        while (next != NULL) {
                                next[0] = '\0';
                                udev_device_add_devlink(udev_device, slink);
@@ -356,9 +360,7 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito
                udev_device_unref(udev_device);
                return NULL;
        }
-
        udev_device_set_devnum(udev_device, makedev(maj, min));
-
        udev_device_set_info_loaded(udev_device);
        return udev_device;
 }