From 52d6a5dd01be615594f0297a3d030c2996a4aa02 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Tue, 29 Aug 2023 16:06:48 +0200 Subject: [PATCH] 2150035 - [abrt] cups-filters: __strlen_avx2(): cups-browsed killed by SIGSEGV --- ...nsure-we-always-send-a-valid-name-to.patch | 41 +++++++++++++++++++ cups-browsed.spec | 6 ++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 0001-cups-browsed.c-Ensure-we-always-send-a-valid-name-to.patch diff --git a/0001-cups-browsed.c-Ensure-we-always-send-a-valid-name-to.patch b/0001-cups-browsed.c-Ensure-we-always-send-a-valid-name-to.patch new file mode 100644 index 0000000..7962b7a --- /dev/null +++ b/0001-cups-browsed.c-Ensure-we-always-send-a-valid-name-to.patch @@ -0,0 +1,41 @@ +From 93285f8bb16bd9fe8e1877999c601346c4c341dc Mon Sep 17 00:00:00 2001 +From: zdohnal +Date: Tue, 29 Aug 2023 12:06:17 +0200 +Subject: [PATCH] cups-browsed.c: Ensure we always send a valid name to + `remove_bad_chars` (#13) + +Fixes Fedora bugzilla #2150035 - in case the found queue is CUPS remote +queue shared via DNS-SD, `rp_value` can be without '/', which leads to +`cups-browsed` crash if it is set to create the local queue based on +remote name. +--- + daemon/cups-browsed.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/daemon/cups-browsed.c b/daemon/cups-browsed.c +index 626473b7..b06461b4 100644 +--- a/daemon/cups-browsed.c ++++ b/daemon/cups-browsed.c +@@ -6185,10 +6185,18 @@ get_local_queue_name(const char *service_name, + // make/model info + queue_name = remove_bad_chars(make_model, 0); + else if (LocalQueueNamingRemoteCUPS == LOCAL_QUEUE_NAMING_REMOTE_NAME) ++ { + // Not directly used in script generation input later, but taken from + // packet, so better safe than sorry. (consider second loop with + // backup_queue_name) +- queue_name = remove_bad_chars(strrchr(resource, '/') + 1, 0); ++ ++ /* We can get resource without / or without string after / - use ++ * the original string (possible trailing / will be removed) */ ++ if ((str = strrchr(resource, '/')) == NULL || strlen(str) <= 1) ++ str = resource; ++ ++ queue_name = remove_bad_chars(str, 0); ++ } + else + // Convert DNS-SD service name into a CUPS queue name exactly + // as CUPS would do it, to override CUPS' own temporary queue +-- +2.41.0 + diff --git a/cups-browsed.spec b/cups-browsed.spec index 181f4a9..f09f973 100644 --- a/cups-browsed.spec +++ b/cups-browsed.spec @@ -12,7 +12,7 @@ Name: cups-browsed Epoch: 1 Version: 2.0~rc2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Daemon for local auto-installation of remote printers # the CUPS exception text is the same as LLVM exception, so using that name with # agreement from legal team @@ -23,6 +23,7 @@ Source0: %{URL}/releases/download/%{upstream_version}/%{name}-%{upstream_version # Patches +Patch001: 0001-cups-browsed.c-Ensure-we-always-send-a-valid-name-to.patch # remove once CentOS Stream 10 is released, cups-browsed @@ -176,6 +177,9 @@ done %changelog +* Tue Aug 29 2023 Zdenek Dohnal - 1:2.0~rc2-3 +- 2150035 - [abrt] cups-filters: __strlen_avx2(): cups-browsed killed by SIGSEGV + * Wed Jul 19 2023 Fedora Release Engineering - 1:2.0~rc2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild