Propagate UTF-8 decoding errors.

This commit is contained in:
Tim Waugh 2013-04-12 11:37:28 +01:00
parent d543dfd79d
commit 70aba906ee
2 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,14 @@
diff -U0 pycups-1.9.63/ChangeLog.encoding pycups-1.9.63/ChangeLog
diff -up pycups-1.9.63/cupsconnection.c.encoding pycups-1.9.63/cupsconnection.c
--- pycups-1.9.63/cupsconnection.c.encoding 2013-04-12 11:35:20.604099365 +0100
+++ pycups-1.9.63/cupsconnection.c 2013-04-12 11:35:34.945163243 +0100
@@ -129,6 +129,9 @@ UTF8_from_PyObj (char **const utf8, PyOb
else if (PyString_Check (obj)) {
const char *ret;
PyObject *unicodeobj = PyUnicode_FromEncodedObject (obj, NULL, NULL);
+ if (unicodeobj == NULL)
+ return NULL;
+
ret = UTF8_from_PyObj (utf8, unicodeobj);
Py_DECREF (unicodeobj);
return ret;

View File

@ -6,10 +6,11 @@
Summary: Python bindings for CUPS
Name: python-cups
Version: 1.9.63
Release: 2%{?dist}
Release: 3%{?dist}
URL: http://cyberelk.net/tim/software/pycups/
Source: http://cyberelk.net/tim/data/pycups/pycups-%{version}.tar.bz2
Patch1: python-cups-uris.patch
Patch2: python-cups-decoding.patch
License: GPLv2+
Group: Development/Languages
BuildRequires: cups-devel
@ -34,6 +35,9 @@ Documentation for python-cups.
# Encode generated URIs correctly (patch from upstream) (bug #950162).
%patch1 -p1 -b .uris
# Propagate UTF-8 decoding errors.
%patch2 -p1 -b .decoding
%build
make CFLAGS="%{optflags} -fno-strict-aliasing"
make doc
@ -52,6 +56,9 @@ make install DESTDIR="%{buildroot}"
%doc examples html
%changelog
* Fri Apr 12 2013 Tim Waugh <twaugh@redhat.com> - 1.9.63-3
- Propagate UTF-8 decoding errors.
* Thu Apr 11 2013 Tim Waugh <twaugh@redhat.com> - 1.9.63-2
- Encode generated URIs correctly (bug #950162).