diff -Nru multipath-tools-0.4.9/debian/changelog multipath-tools-0.4.9/debian/changelog --- multipath-tools-0.4.9/debian/changelog 2016-03-21 14:41:45.000000000 +0000 +++ multipath-tools-0.4.9/debian/changelog 2016-05-12 09:04:32.000000000 +0000 @@ -1,3 +1,9 @@ +multipath-tools (0.4.9-3ubuntu7.12) trusty; urgency=medium + + * 0044-multipath-check-for-NULL-from-udev_device_get.patch (LP: #1532789) + + -- Rafael David Tinoco Thu, 12 May 2016 11:03:37 +0200 + multipath-tools (0.4.9-3ubuntu7.11) trusty; urgency=medium * debian/patches/series: add dm-multipath-backlist-nvme-5c412e47.patch to diff -Nru multipath-tools-0.4.9/debian/patches/0044-multipath-check-for-NULL-from-udev_device_get.patch multipath-tools-0.4.9/debian/patches/0044-multipath-check-for-NULL-from-udev_device_get.patch --- multipath-tools-0.4.9/debian/patches/0044-multipath-check-for-NULL-from-udev_device_get.patch 1970-01-01 00:00:00.000000000 +0000 +++ multipath-tools-0.4.9/debian/patches/0044-multipath-check-for-NULL-from-udev_device_get.patch 2016-05-12 09:00:45.000000000 +0000 @@ -0,0 +1,74 @@ +From e546687e046b1eb1cbe5567e9d7850cbbd682dba Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Sat, 12 Jan 2013 00:04:54 -0600 +Subject: [PATCH] multipath: check for NULL from udev_device_get_* + +The udev_device_get_* functions can return NULL, an occassionally do +so in the multipathd code. multipath needs to check if the result +is NULL before dereferencing it. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/discovery.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -115,6 +115,7 @@ + + udev_list_entry_foreach(entry, + udev_enumerate_get_list_entry(udev_iter)) { ++ const char *devtype; + devpath = udev_list_entry_get_name(entry); + condlog(4, "Discover device %s", devpath); + udevice = udev_device_new_from_syspath(conf->udev, devpath); +@@ -123,7 +124,8 @@ + r++; + continue; + } +- if(!strncmp(udev_device_get_devtype(udevice), "disk", 4)) ++ devtype = udev_device_get_devtype(udevice); ++ if(devtype && !strncmp(devtype, "disk", 4)) + r += path_discover(pathvec, conf, udevice, flag); + udev_device_unref(udevice); + } +@@ -438,7 +440,8 @@ + + parent = pp->udev; + while (parent) { +- if (!strncmp(udev_device_get_subsystem(parent), "scsi", 4)) { ++ const char *subsys = udev_device_get_subsystem(parent); ++ if (subsys && !strncmp(subsys, "scsi", 4)) { + attr_path = udev_device_get_sysname(parent); + if (!attr_path) + break; +@@ -504,7 +507,8 @@ + + parent = pp->udev; + while (parent) { +- if (!strncmp(udev_device_get_subsystem(parent), "ccw", 3)) ++ const char *subsys = udev_device_get_subsystem(parent); ++ if (subsys && !strncmp(subsys, "ccw", 3)) + break; + parent = udev_device_get_parent(parent); + } +@@ -560,7 +564,8 @@ + + parent = pp->udev; + while (parent) { +- if (!strncmp(udev_device_get_subsystem(parent), "cciss", 5)) { ++ const char *subsys = udev_device_get_subsystem(parent); ++ if (subsys && !strncmp(subsys, "cciss", 5)) { + attr_path = udev_device_get_sysname(parent); + if (!attr_path) + break; +@@ -641,7 +646,8 @@ + + parent = pp->udev; + while (parent) { +- if (!strncmp(udev_device_get_subsystem(parent), "scsi", 4)) ++ const char *subsys = udev_device_get_subsystem(parent); ++ if (subsys && !strncmp(subsys, "scsi", 4)) + break; + parent = udev_device_get_parent(parent); + } diff -Nru multipath-tools-0.4.9/debian/patches/series multipath-tools-0.4.9/debian/patches/series --- multipath-tools-0.4.9/debian/patches/series 2016-03-21 14:40:43.000000000 +0000 +++ multipath-tools-0.4.9/debian/patches/series 2016-05-12 09:00:38.000000000 +0000 @@ -76,3 +76,4 @@ kpartx_rely_on_udev_dev_creation_9a632fff.patch multipath_enable_sync_support_1b8082c8.patch dm-multipath-backlist-nvme-5c412e47.patch +0044-multipath-check-for-NULL-from-udev_device_get.patch