From f162a59f0f73dbbef6fee01edcbe40defffc6f33 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 12 Apr 2011 11:13:02 +0100 Subject: [PATCH] Prevent segfault when running gstoraster outside CUPS. --- ghostscript-colord.patch | 19 +++++++++++++++++++ ghostscript.spec | 9 ++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ghostscript-colord.patch diff --git a/ghostscript-colord.patch b/ghostscript-colord.patch new file mode 100644 index 0000000..4dae090 --- /dev/null +++ b/ghostscript-colord.patch @@ -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) { diff --git a/ghostscript.spec b/ghostscript.spec index bf8cdf8..2ae64f5 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -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 9.02-3 +- Prevent segfault when running gstoraster outside CUPS. + * Thu Apr 7 2011 Tim Waugh - Remove bundled expat directory. Not used, but this makes it clearer.