From 61e9e90047c6e360e7a632f4db4dbff5f8486db3 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Aug 13 2019 07:15:25 +0000 Subject: 1740122 - foomatic-rip segfaults when env variable PRINTER is not defined --- diff --git a/cups-filters-foomaticrip-segfault.patch b/cups-filters-foomaticrip-segfault.patch new file mode 100644 index 0000000..885bdcd --- /dev/null +++ b/cups-filters-foomaticrip-segfault.patch @@ -0,0 +1,14 @@ +diff --git a/filter/foomatic-rip/spooler.c b/filter/foomatic-rip/spooler.c +index 4f27563..fee55a8 100644 +--- a/filter/foomatic-rip/spooler.c ++++ b/filter/foomatic-rip/spooler.c +@@ -94,8 +94,7 @@ void init_cups(list_t *arglist, dstr_t *filelist, jobparams_t *job) + CUPS puts the print queue name into the PRINTER environment variable + when calling filters. */ + strncpy(job->printer, getenv("PRINTER"), 256); +- if (strlen(getenv("PRINTER")) > 255) +- job->printer[255] = '\0'; ++ job->printer[255] = '\0'; + + free(cups_options); + } diff --git a/cups-filters.spec b/cups-filters.spec index 755817f..798d88c 100644 --- a/cups-filters.spec +++ b/cups-filters.spec @@ -4,7 +4,7 @@ Summary: OpenPrinting CUPS filters and backends Name: cups-filters Version: 1.22.5 -Release: 3%{?dist} +Release: 4%{?dist} # For a breakdown of the licensing, see COPYING file # GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*, @@ -27,6 +27,9 @@ Patch01: cups-filters-createall.patch # instead of 'cups-browsed' as Ubuntu does. I can repack the project later, # so cups-browsed would have separate sub package, so the link would be correct Patch02: cups-browsed.8.patch +# issue caused by bad covscan fix, strlen() was called on NULL pointer, +# fixed upstream +Patch03: cups-filters-foomaticrip-segfault.patch Requires: cups-filters-libs%{?_isa} = %{version}-%{release} @@ -133,6 +136,8 @@ This is the development package for OpenPrinting CUPS filters and backends. %patch01 -p1 -b .createall # links in manpage %patch02 -p1 -b .manpage +# 1740122 - foomatic-rip segfaults when env variable PRINTER is not defined +%patch03 -p1 -b .foomaticrip-segfault %build # work-around Rpath @@ -281,6 +286,9 @@ make check %{_libdir}/libfontembed.so %changelog +* Tue Aug 13 2019 Zdenek Dohnal - 1.22.5-4 +- 1740122 - foomatic-rip segfaults when env variable PRINTER is not defined + * Wed Aug 07 2019 Zdenek Dohnal - 1.22.5-3 - remove unneeded scriptlet