Prevent segfault when running gstoraster outside CUPS.

This commit is contained in:
Tim Waugh 2011-04-12 11:13:02 +01:00
parent 9aeffaf6ca
commit f162a59f0f
2 changed files with 27 additions and 1 deletions

19
ghostscript-colord.patch Normal file
View File

@ -0,0 +1,19 @@
diff -up ghostscript-9.02/cups/colord.c.colord ghostscript-9.02/cups/colord.c
--- ghostscript-9.02/cups/colord.c.colord 2011-04-12 11:09:49.852203837 +0100
+++ ghostscript-9.02/cups/colord.c 2011-04-12 11:11:11.226356829 +0100
@@ -316,9 +316,14 @@ char *
colord_get_profile_for_device_id (const char *device_id,
const char **qualifier_tuple)
{
- DBusConnection *con;
+ DBusConnection *con = NULL;
char *filename = NULL;
+ if (device_id == NULL) {
+ fprintf(stderr, "DEBUG: No colord device ID available\n");
+ goto out;
+ }
+
/* connect to system bus */
con = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
if (con == NULL) {

View File

@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer
Name: ghostscript
Version: %{gs_ver}
Release: 2%{?dist}
Release: 3%{?dist}
# Included CMap data is Redistributable, no modification permitted,
# see http://bugzilla.redhat.com/487510
@ -21,6 +21,7 @@ Patch2: ghostscript-scripts.patch
Patch3: ghostscript-noopt.patch
Patch4: ghostscript-ijs-automake-ver.patch
Patch5: ghostscript-runlibfileifexists.patch
Patch6: ghostscript-colord.patch
Patch7: ghostscript-pksmraw.patch
Patch8: ghostscript-jbig2dec-nullderef.patch
Patch10: ghostscript-cups-filters.patch
@ -124,6 +125,9 @@ rm -rf libpng zlib jpeg jasper expat
# Define .runlibfileifexists.
%patch5 -p1
# Prevent segfault when running gstoraster outside CUPS.
%patch6 -p1 -b .colord
# Fix pksmraw output (bug #308211). Still needed in 8.63.
%patch7 -p1 -b .pksmraw
@ -346,6 +350,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libgs.so
%changelog
* Tue Apr 12 2011 Tim Waugh <twaugh@redhat.com> 9.02-3
- Prevent segfault when running gstoraster outside CUPS.
* Thu Apr 7 2011 Tim Waugh <twaugh@redhat.com>
- Remove bundled expat directory. Not used, but this makes it
clearer.