[python-cups] Apply upstream patch to fix crash on loading invalid PPDs (bug #811159).
Tim Waugh
twaugh at fedoraproject.org
Tue Apr 10 11:33:54 UTC 2012
commit b3444592e084c1d244c97dcef6a47a8d0bba4966
Author: Tim Waugh <twaugh at redhat.com>
Date: Tue Apr 10 12:23:39 2012 +0100
Apply upstream patch to fix crash on loading invalid PPDs (bug #811159).
python-cups-ppd-null.patch | 28 ++++++++++++++++++++++++++++
python-cups.spec | 10 +++++++++-
2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/python-cups-ppd-null.patch b/python-cups-ppd-null.patch
new file mode 100644
index 0000000..557efaa
--- /dev/null
+++ b/python-cups-ppd-null.patch
@@ -0,0 +1,28 @@
+diff -U0 pycups-1.9.61/ChangeLog.ppd-null pycups-1.9.61/ChangeLog
+--- pycups-1.9.61/ChangeLog.ppd-null 2012-03-06 10:53:09.000000000 +0000
++++ pycups-1.9.61/ChangeLog 2012-04-10 12:22:16.224974764 +0100
+@@ -0,0 +1,5 @@
++2012-03-22 Tim Waugh <twaugh at redhat.com>
++
++ * cupsppd.c (PPD_dealloc): Add missing NULL check for
++ debugging message (Ubuntu #951001). Patch from Till Kamppeter.
++
+diff -up pycups-1.9.61/cupsppd.c.ppd-null pycups-1.9.61/cupsppd.c
+--- pycups-1.9.61/cupsppd.c.ppd-null 2011-12-08 13:22:35.000000000 +0000
++++ pycups-1.9.61/cupsppd.c 2012-04-10 12:22:16.224974764 +0100
+@@ -236,10 +236,12 @@ PPD_init (PPD *self, PyObject *args, PyO
+ static void
+ PPD_dealloc (PPD *self)
+ {
+- debugprintf ("- PPD %p (fd %d)\n", self, fileno (self->file));
+-
+- if (self->file)
++ if (self->file) {
++ debugprintf ("- PPD %p (fd %d)\n", self, fileno (self->file));
+ fclose (self->file);
++ } else
++ debugprintf ("- PPD %p (no fd)\n", self);
++
+ if (self->ppd)
+ ppdClose (self->ppd);
+ if (self->conv_from)
diff --git a/python-cups.spec b/python-cups.spec
index 849a23e..d4dc48b 100644
--- a/python-cups.spec
+++ b/python-cups.spec
@@ -6,7 +6,7 @@
Summary: Python bindings for CUPS
Name: python-cups
Version: 1.9.61
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://cyberelk.net/tim/software/pycups/
Source: http://cyberelk.net/tim/data/pycups/pycups-%{version}.tar.bz2
License: GPLv2+
@@ -15,6 +15,8 @@ BuildRequires: cups-devel
BuildRequires: python2-devel
BuildRequires: epydoc
+Patch1: python-cups-ppd-null.patch
+
Conflicts: rpm-build < 4.9.0
%description
@@ -32,6 +34,9 @@ Documentation for python-cups.
%prep
%setup -q -n pycups-%{version}
+# Apply upstream patch to fix crash on loading invalid PPDs (bug #811159).
+%patch1 -p1 -b .ppd-null
+
%build
make CFLAGS="%{optflags} -fno-strict-aliasing"
make doc
@@ -52,6 +57,9 @@ make install DESTDIR="%{buildroot}"
%doc examples html
%changelog
+* Tue Apr 10 2012 Tim Waugh <twaugh at redhat.com> - 1.9.61-2
+- Apply upstream patch to fix crash on loading invalid PPDs (bug #811159).
+
* Tue Mar 6 2012 Tim Waugh <twaugh at redhat.com> - 1.9.61-1
- 1.9.61, fixing ref-counting bugs (bug #800143).
More information about the scm-commits
mailing list