ryantimwilson / rpms / systemd

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