Package: foomatic-filters
Version: 4.0-20090509-1
Severity: important
File: foomatic
Tags: patch

Hi,

Printing with CUPS failed after upgrade to foomatic-filters-4.0.  I tracked
the problem down to a NULL pointer dereference in foomatic-rip, that seems
to be caused by my PPD generated by alignmargins
(http://www.linuxprinting.org/download/printing/alignmargins).

I have attached a patch that fixes the problem for me, it propably doesn't
fix it properly but it illustrates the problem.  I have also attached a
minimal PPD file and a script that invokes foomatic-rip with input that
triggers the bug.

Regards,
  Fredrik

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages foomatic-filters depends on:
ii  bash                        3.2-5        The GNU Bourne Again SHell
ii  debconf [debconf-2.0]       1.5.27       Debian configuration management sy
ii  libc6                       2.9-12       GNU C Library: Shared libraries
ii  libgs8                      8.64~dfsg-13 The Ghostscript PostScript/PDF int
ii  perl                        5.10.0-24    Larry Wall's Practical Extraction 
ii  ucf                         3.0018       Update Configuration File: preserv

Versions of packages foomatic-filters recommends:
ii  a2ps                   1:4.14-1          GNU a2ps - 'Anything to PostScript
ii  cups                   1.3.11-1          Common UNIX Printing System(tm) - 
ii  cups-bsd [lpr]         1.3.11-1          Common UNIX Printing System(tm) - 
ii  cups-client            1.3.11-1          Common UNIX Printing System(tm) - 
ii  foomatic-db-engine     4.0-20090509-1+b1 OpenPrinting printer support - pro
ii  ghostscript            8.64~dfsg-13      The GPL Ghostscript PostScript/PDF

foomatic-filters suggests no packages.

-- debconf information:
  foomatic-filters/config_parsed: true
  foomatic-filters/spooler: direct
  foomatic-filters/textfilter: Automagic
  foomatic-filters/filter_debug: false
  foomatic-filters/ps_accounting: false
  foomatic-filters/custom_textfilter:
#!/bin/bash

export PPD=foomatic-test.ppd
foomatic-rip 1 $(whoami) job-name 1 "" <<'EOF'
%!PS-Adobe-3.0
%%BeginFeature: *Margins Custom
<</.HWMargins[12 1 11.5 67] /Margins[0 -468.75]>>setpagedevice
%%EndFeature
EOF
*OpenUI *Margins/Page Margins/Offsets: PickOne
--- foomatic-filters-4.0-20090509/postscript.c	2009-05-09 09:27:25.000000000 +0200
+++ foomatic-filters-4.0-20090509.fix/postscript.c	2009-08-02 19:12:04.000000000 +0200
@@ -728,7 +728,7 @@
                             if (spooler == SPOOLER_CUPS &&
                                 linetype == LT_BEGIN_FEATURE &&
                                 !option_get_value(o, optionset("notfirst")) &&
-                                strcmp(option_get_value(o, optset), value) != 0 &&
+                                strcmp(option_get_value(o, optset) ?: "", value) != 0 &&
                                 (inheader || option_get_section(o) == SECTION_PAGESETUP)) {
 
                                 /* We have the first occurence of an option

Reply via email to