Blame SOURCES/0374-udev-path_id-correct-segmentation-fault-due-to-missi.patch

17b0f1
From fb9a50a0ad64f28c00c7d0bbc4ee8908d4233593 Mon Sep 17 00:00:00 2001
17b0f1
From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
17b0f1
Date: Fri, 19 Feb 2016 15:21:18 +0100
17b0f1
Subject: [PATCH] udev/path_id: correct segmentation fault due to missing NULL
17b0f1
 check
17b0f1
17b0f1
Running "udevadm test-builtin path_id /sys/devices/platform/" results
17b0f1
in a segmentation fault.
17b0f1
17b0f1
The problem is that udev_device_get_subsystem(dev) might return NULL
17b0f1
in a streq() call.  Solve this problem by using streq_ptr() instead.
17b0f1
17b0f1
Cherry-picked from: 5181ab917d6407cb57043e98955f0de1614366ea
17b0f1
Resolves: #1365556
17b0f1
---
17b0f1
 src/udev/udev-builtin-path_id.c | 2 +-
17b0f1
 1 file changed, 1 insertion(+), 1 deletion(-)
17b0f1
17b0f1
diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c
17b0f1
index 8359e236a1..a3b019bfc5 100644
17b0f1
--- a/src/udev/udev-builtin-path_id.c
17b0f1
+++ b/src/udev/udev-builtin-path_id.c
17b0f1
@@ -729,7 +729,7 @@ restart:
17b0f1
          * devices do not expose their buses and do not provide a unique
17b0f1
          * and predictable name that way.
17b0f1
          */
17b0f1
-        if (streq(udev_device_get_subsystem(dev), "block") && !supported_transport) {
17b0f1
+        if (streq_ptr(udev_device_get_subsystem(dev), "block") && !supported_transport) {
17b0f1
                 free(path);
17b0f1
                 path = NULL;
17b0f1
         }