- Prevent segfault in cupsext when opening PPD file (bug #572775).

This commit is contained in:
Jiří Popelka 2010-05-12 15:44:36 +00:00
parent c61e2c2a13
commit bf4cb7cf06
2 changed files with 32 additions and 1 deletions

24
hplip-openPPD.patch Normal file
View File

@ -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 );

View File

@ -1,7 +1,7 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.10.2
Release: 15%{?dist}
Release: 16%{?dist}
License: GPLv2+ and MIT
Group: System Environment/Daemons
Conflicts: system-config-printer < 0.6.132
@ -32,6 +32,7 @@ Patch17: hplip-deviceIDs-ppd.patch
Patch18: hplip-skip-blank-lines.patch
Patch19: hplip-dbglog-newline.patch
Patch20: hplip-no-system-tray.patch
Patch21: hplip-openPPD.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -200,6 +201,9 @@ done
# Wait for max 30s to see if a system tray becomes available (bug #569969).
%patch20 -p1 -b .no-system-tray
# Prevent segfault in cupsext when opening PPD file (bug #572775).
%patch21 -p1 -b .openPPD
sed -i.duplex-constraints \
-e 's,\(UIConstraints.* \*Duplex\),//\1,' \
prnt/drv/hpcups.drv.in
@ -421,6 +425,9 @@ fi
%{_bindir}/hpcups-update-ppds &>/dev/null ||:
%changelog
* Wed May 12 2010 Jiri Popelka <jpopelka@redhat.com> - 3.10.2-16
- Prevent segfault in cupsext when opening PPD file (bug #572775).
* Wed May 12 2010 Jiri Popelka <jpopelka@redhat.com> - 3.10.2-15
- Added/corrected more IEEE 1284 Device IDs:
- HP LaserJet 4250 (bug #585499).