2b68233
From 28c6938992e05238fa077ff820015bb37e1ecae6 Mon Sep 17 00:00:00 2001
2b68233
From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
2b68233
Date: Fri, 19 Feb 2016 15:21:18 +0100
2b68233
Subject: [PATCH] udev/path_id: correct segmentation fault due to missing NULL
2b68233
 check
2b68233
2b68233
Running "udevadm test-builtin path_id /sys/devices/platform/" results
2b68233
in a segmentation fault.
2b68233
2b68233
The problem is that udev_device_get_subsystem(dev) might return NULL
2b68233
in a streq() call.  Solve this problem by using streq_ptr() instead.
2b68233
2b68233
(cherry picked from commit 5181ab917d6407cb57043e98955f0de1614366ea)
2b68233
---
2b68233
 src/udev/udev-builtin-path_id.c | 2 +-
2b68233
 1 file changed, 1 insertion(+), 1 deletion(-)
2b68233
2b68233
diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c
2b68233
index b6ed45d8ba..6e9adc6e96 100644
2b68233
--- a/src/udev/udev-builtin-path_id.c
2b68233
+++ b/src/udev/udev-builtin-path_id.c
2b68233
@@ -712,7 +712,7 @@ static int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool
2b68233
          * devices do not expose their buses and do not provide a unique
2b68233
          * and predictable name that way.
2b68233
          */
2b68233
-        if (streq(udev_device_get_subsystem(dev), "block") && !supported_transport)
2b68233
+        if (streq_ptr(udev_device_get_subsystem(dev), "block") && !supported_transport)
2b68233
                 path = mfree(path);
2b68233
 
2b68233
         if (path != NULL) {