summaryrefslogtreecommitdiffstats
path: root/src/udev
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2016-02-19 15:21:18 +0100
committerHendrik Brueckner <brueckner@linux.vnet.ibm.com>2016-02-19 15:21:18 +0100
commit5181ab917d6407cb57043e98955f0de1614366ea (patch)
tree5852ce7d7d900700c3ed11da5a346b12f4129dd1 /src/udev
parentMerge pull request #2661 from nwmcsween/nwmcsween (diff)
downloadsystemd-5181ab917d6407cb57043e98955f0de1614366ea.tar.xz
systemd-5181ab917d6407cb57043e98955f0de1614366ea.zip
udev/path_id: correct segmentation fault due to missing NULL check
Running "udevadm test-builtin path_id /sys/devices/platform/" results in a segmentation fault. The problem is that udev_device_get_subsystem(dev) might return NULL in a streq() call. Solve this problem by using streq_ptr() instead.
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udev-builtin-path_id.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c
index b6ed45d8ba..6e9adc6e96 100644
--- a/src/udev/udev-builtin-path_id.c
+++ b/src/udev/udev-builtin-path_id.c
@@ -712,7 +712,7 @@ static int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool
* devices do not expose their buses and do not provide a unique
* and predictable name that way.
*/
- if (streq(udev_device_get_subsystem(dev), "block") && !supported_transport)
+ if (streq_ptr(udev_device_get_subsystem(dev), "block") && !supported_transport)
path = mfree(path);
if (path != NULL) {