From b13b64c8bf6252ebafc18e7689392664dacb22de Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Tue, 29 Oct 2019 12:04:28 +0100 Subject: [PATCH] 1765915 - abrt in udev-configure-printer --- ...onfigure-printer-Add-checks-for-NULL.patch | 61 +++++++++++++++++++ system-config-printer.spec | 7 ++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 0001-udev-configure-printer-Add-checks-for-NULL.patch diff --git a/0001-udev-configure-printer-Add-checks-for-NULL.patch b/0001-udev-configure-printer-Add-checks-for-NULL.patch new file mode 100644 index 0000000..f4314b2 --- /dev/null +++ b/0001-udev-configure-printer-Add-checks-for-NULL.patch @@ -0,0 +1,61 @@ +From cf9903466c1a2d18a701f3b5e8c7e03483e1244d Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal +Date: Mon, 14 Oct 2019 16:39:28 +0200 +Subject: [PATCH] udev-configure-printer: Add checks for NULL + +--- + NEWS | 1 + + udev/udev-configure-printer.c | 12 +++++++++--- + 2 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/NEWS b/NEWS +index f4b774e5..0b53aa8e 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,5 +1,6 @@ + 1.5.13 changes + -------------- ++- add checks for NULL in udev-configure-printer (Fedora #1761097) + + 1.5.12 changes + -------------- +diff --git a/udev/udev-configure-printer.c b/udev/udev-configure-printer.c +index 83092fc2..d753bbea 100644 +--- a/udev/udev-configure-printer.c ++++ b/udev/udev-configure-printer.c +@@ -1411,7 +1411,7 @@ for_each_matching_queue (struct device_uris *device_uris, + const char *printer_state_message = NULL; + int state = 0; + size_t i, l; +- char *this_device_uri_n, *device_uri_n; ++ char *this_device_uri_n = NULL, *device_uri_n = NULL; + const char *ps1, *ps2, *pi1, *pi2; + + while (attr && ippGetGroupTag (attr) != IPP_TAG_PRINTER) +@@ -1448,6 +1448,8 @@ for_each_matching_queue (struct device_uris *device_uris, + for (i = 0; i < device_uris->n_uris; i++) + { + device_uri_n = normalize_device_uri(device_uris->uri[i]); ++ if (this_device_uri_n == NULL || device_uri_n == NULL) ++ goto skip; + /* As for the same device different URIs can come out when the + device is accessed via the usblp kernel module or via low- + level USB (libusb) we cannot simply compare URIs, must +@@ -1512,8 +1514,12 @@ for_each_matching_queue (struct device_uris *device_uris, + firstqueue = 0; + + skip: +- free(device_uri_n); +- free(this_device_uri_n); ++ if (device_uri_n != NULL) ++ free(device_uri_n); ++ device_uri_n = NULL; ++ if (this_device_uri_n != NULL) ++ free(this_device_uri_n); ++ this_device_uri_n = NULL; + if (!attr) + break; + } +-- +2.21.0 + diff --git a/system-config-printer.spec b/system-config-printer.spec index 14280ef..76b9a9f 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -9,12 +9,13 @@ Summary: A printer administration tool Name: system-config-printer Version: 1.5.12 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: https://github.com/%{username}/%{name} Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.gz # all upstream patches, remove with new release +Patch01: 0001-udev-configure-printer-Add-checks-for-NULL.patch # gcc is no longer in buildroot by default # gcc is needed for udev-configure-printer.c @@ -86,6 +87,7 @@ printers. %prep %setup -q # all backported from upstream +%patch01 -p1 -b .udev-configure-segfault %build %configure --with-udev-rules @@ -211,6 +213,9 @@ touch %buildroot%{_localstatedir}/run/udev-configure-printer/usb-uris exit 0 %changelog +* Tue Oct 29 2019 Zdenek Dohnal - 1.5.12-2 +- 1765915 - abrt in udev-configure-printer + * Tue Oct 01 2019 Zdenek Dohnal - 1.5.12-1 - 1.5.12