James Cloos [Mon, 24 Jun 2013 02:48:18 +0000 (22:48 -0400)]
Permit use of Poppler’s pdftocairo for PDF→PostScript conversion.
This allows one to select pdftocairo(1) rather than GhostScript, pdftops
or acroread for converting PDF files to PostScript.
GhostScript and Poppler’s PSOutputDev:: (used by pdftops) currently raster
an entire page whenever it contains non-opaque objects, whereas cairo will
only raster those areas of the page where the non-opacity exists.
Conversely, cairo only knows sRGB, and thus is unsuitable for files which
make use of any other Colour Space, so it is not yet suitable to be the
default option for the pdftops filter.
Jiri Popelka [Tue, 7 May 2013 07:01:52 +0000 (09:01 +0200)]
Fix several RESOURCE_LEAKs in filters
Error: RESOURCE_LEAK (CWE-772):
filter/texttopdf.c:1215: var_assign: Assigning: "pagestr" = storage returned from "make_wide(tmp)".
filter/texttopdf.c:1225: leaked_storage: Variable "pagestr" going out of scope leaks the storage it points to.
Error: RESOURCE_LEAK (CWE-772):
filter/textcommon.c:534: var_assign: Assigning: "fp" = storage returned from "fopen(argv[6], "rb")".
filter/textcommon.c:612: leaked_storage: Variable "fp" going out of scope leaks the storage it points to.
filter/textcommon.c:623: leaked_storage: Variable "fp" going out of scope leaks the storage it points to.
filter/textcommon.c:634: leaked_storage: Variable "fp" going out of scope leaks the storage it points to.
Error: RESOURCE_LEAK (CWE-772):
cupsfilters/image-tiff.c:312: var_assign: Assigning: "in" = storage returned from "malloc(img->xsize * 3U + 3U)".
cupsfilters/image-tiff.c:660: leaked_storage: Variable "in" going out of scope leaks the storage it points to.
Jiri Popelka [Mon, 6 May 2013 17:08:25 +0000 (19:08 +0200)]
fontembed/embed_sfnt.c: OVERRUN
Error: OVERRUN (CWE-119):
fontembed/embed_sfnt.c:337: cond_at_most: Checking "idx < 258" implies that the value of "idx" may be up to 257 on the true branch.
fontembed/embed_sfnt.c:339: overrun-local: Overrunning array "macRoman" of 1 8-byte elements at element index 257 (byte offset 2056) using index "idx" (which evaluates to 257).
Jiri Popelka [Mon, 6 May 2013 16:26:11 +0000 (18:26 +0200)]
pdftopdf/NupParameters::possible() fix condition
Error: DEADCODE (CWE-561):
filter/pdftopdf/nup.cc:54: cond_at_least: Condition "nup >= 1", taking true branch. Now the value of "nup" is at least 1.
filter/pdftopdf/nup.cc:54: cond_between: Condition "nup <= 16", taking true branch. Now the value of "nup" is between 1 and 16.
filter/pdftopdf/nup.cc:54: cond_const: Condition "nup != 5", taking false branch. Now the value of "nup" is equal to 5.
filter/pdftopdf/nup.cc:54: const: At condition "nup != 7", the value of "nup" must be equal to 5.
filter/pdftopdf/nup.cc:54: dead_error_condition: The condition "nup != 7" must be true.
filter/pdftopdf/nup.cc:54: dead_error_line: Execution cannot reach this expression "nup != 11" inside statement "return nup >= 1 && nup <= 1...".
Jiri Popelka [Mon, 6 May 2013 16:23:52 +0000 (18:23 +0200)]
cups-browsed: fix memleak in handle_cups_queues()
331,936 (1,472 direct, 330,464 indirect) bytes in
23 blocks are definitely lost in loss record
by 0x4E71CCB: ippNew (ipp.c:2337)
by 0x4E86C14: cupsGetResponse (request.c:398)
by 0x4E87738: cupsDoIORequest (request.c:263)
by 0x10BDB9: handle_cups_queues (cups-browsed.c:375)
by 0x10B4F5: main (cups-browsed.c:1971)
Jiri Popelka [Mon, 6 May 2013 16:22:44 +0000 (18:22 +0200)]
cups-browsed: fix memleak in browse_poll()
20 bytes in 1 blocks are definitely lost in loss record
by 0x7415159: strdup (strdup.c:42)
by 0x10D727: browse_poll (cups-browsed.c:1477)
by 0x10B48D: main (cups-browsed.c:1950)
Jiri Popelka [Mon, 6 May 2013 16:21:36 +0000 (18:21 +0200)]
cups-browsed: fix memory leaks in generate_local_queue()
1,748 bytes in 92 blocks are definitely lost in loss record
by 0x7415159: strdup (strdup.c:42)
by 0x10C9A3: generate_local_queue (cups-browsed.c:582)
by 0x10D2DC: found_cups_printer (cups-browsed.c:1003)
by 0x10D930: browse_poll (cups-browsed.c:1550)
by 0x10B472: main (cups-browsed.c:1946)
3,344 bytes in 92 blocks are definitely lost in loss record
by 0x10CA22: generate_local_queue (cups-browsed.c:593)
by 0x10D2DC: found_cups_printer (cups-browsed.c:1003)
by 0x10D930: browse_poll (cups-browsed.c:1550)
by 0x10B472: main (cups-browsed.c:1946)
Jiri Popelka [Mon, 6 May 2013 16:17:54 +0000 (18:17 +0200)]
cups-browsed: fix 'invalid read of size 8'
Invalid read of size 8
at 0x10B45F: main (cups-browsed.c:1938)
Address 0x9d42318 is 0 bytes after a block of size 8 alloc'd
by 0x10E63B: read_configuration (cups-browsed.c:1692)
by 0x10B179: main (cups-browsed.c:1734)
Till Kamppeter [Fri, 15 Feb 2013 21:23:46 +0000 (22:23 +0100)]
Added BrowsePoll and CUPS Browsing functionality
Applied patches from Tim Waugh from Red Hat to add BrowsePoll (poll CUPS queues
from server specified in config file) and CUPS Browsing (listen to CUPS
broadcast packets of CUPS 1.5.x and older servers).
Till Kamppeter [Wed, 26 Dec 2012 19:56:02 +0000 (20:56 +0100)]
Added cups-browsed, daemon for browsing Bonjour-broadcasted remote printers
This is mainly a commit to save work. The integration in the build
system is still missing. See the README file on what cups-browsed does
and how to build it in the time being.