From 38a666f5196722e90fd2b6603b4395317453b79d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Popelka?= Date: Wed, 12 May 2010 15:44:12 +0000 Subject: [PATCH] - Prevent segfault in cupsext when opening PPD file (bug #572775). --- hplip-openPPD.patch | 24 ++++++++++++++++++++++++ hplip.spec | 10 +++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 hplip-openPPD.patch diff --git a/hplip-openPPD.patch b/hplip-openPPD.patch new file mode 100644 index 0000000..7ccf2d0 --- /dev/null +++ b/hplip-openPPD.patch @@ -0,0 +1,24 @@ +diff -up hplip-3.10.2/prnt/cupsext/cupsext.c.openPPD hplip-3.10.2/prnt/cupsext/cupsext.c +--- hplip-3.10.2/prnt/cupsext/cupsext.c.openPPD 2010-02-25 00:04:58.000000000 +0100 ++++ hplip-3.10.2/prnt/cupsext/cupsext.c 2010-03-17 19:54:19.000000000 +0100 +@@ -1221,9 +1221,18 @@ PyObject * openPPD( PyObject * self, PyO + return Py_BuildValue( "" ); // None + } + +- g_ppd_file = cupsGetPPD( ( const char * ) printer ); ++ if ( ( g_ppd_file = cupsGetPPD( ( const char * ) printer ) ) == NULL ) ++ { ++ goto bailout; ++ } ++ ++ if ( ( file = fopen( g_ppd_file, "r" )) == NULL ) ++ { ++ unlink(g_ppd_file); ++ g_ppd_file = NULL; ++ goto bailout; ++ } + +- file = fopen( g_ppd_file, "r" ); + ppd = ppdOpen( file ); + ppdLocalize( ppd ); + fclose( file ); diff --git a/hplip.spec b/hplip.spec index 5452fca..e81bdf5 100644 --- a/hplip.spec +++ b/hplip.spec @@ -1,7 +1,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.10.2 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2+ and MIT Group: System Environment/Daemons Conflicts: system-config-printer < 0.6.132 @@ -30,6 +30,8 @@ Patch16: hplip-bad-low-ink-warning.patch Patch17: hplip-skip-blank-lines.patch Patch18: hplip-dbglog-newline.patch Patch19: hplip-no-system-tray.patch +Patch20: hplip-openPPD.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(pre): /sbin/service @@ -170,6 +172,9 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version} # Wait for max 30s to see if a system tray becomes available (bug #569969). %patch19 -p1 -b .no-system-tray +# Prevent segfault in cupsext when opening PPD file (bug #572775). +%patch20 -p1 -b .openPPD + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -390,6 +395,9 @@ fi %{_bindir}/hpcups-update-ppds &>/dev/null ||: %changelog +* Wed May 12 2010 Jiri Popelka - 3.10.2-10 +- Prevent segfault in cupsext when opening PPD file (bug #572775). + * Tue May 11 2010 Jiri Popelka - 3.10.2-9 - Wait for max 30s to see if a system tray becomes available (bug #569969).