New Ghostscript/GhostPDL compiler warnings - 2018-07-26-00:30:22 - 2f017502459778cac3c2b8cb2c6df2f52629aae3

[email protected] Thu, 26 Jul 2018 02:48:43 -0700 (PDT)
Newsgroups gmane.comp.printing.ghostscript.regression
Message-ID <20180726094843.86BC2204034E@i7>
Previous Revision: d735b5ae0b8fc6573f09aee9b8663612bdde3c9b
 Current Revision: 2f017502459778cac3c2b8cb2c6df2f52629aae3

commit 2f017502459778cac3c2b8cb2c6df2f52629aae3
Author:     Ken Sharp <[email protected]>
AuthorDate: Thu Jul 26 08:28:23 2018 +0100
CommitDate: Thu Jul 26 08:28:56 2018 +0100

    pdfwrite - don't retry CharProc capture on error.
    
    Bug #699561 "Infinite loop or Segfault"
    
    The input PostScript file for this case is invalid and throws a
    rangecheck error with normal devices.
    
    However when the output device is pdfwrite in the case of *any* error
    handling text we fall back to the 'default implementation' which means
    we run the glyph description normally, and capture the bitmap into a
    type 3 bitmap font.
    
    In the case of this file, however, when we try to use the captured
    bitmap we again throw an error. This causes us to run the glyph
    description again and capture the bitmap. Of course, that again fails
    when we try to use it leading to an infinite loop. But not any simple
    loop, it involves exiting the code and re-entering it after capture.
    
    This commit adds a new variable, captured_pte_index. When we complete
    a capture, we record the index (the pointer to the input character codes)
    from the text enumerator. We then try to process the text as normal. If
    we get an error, before falling back to the default implementation, we
    test the current text enumerator index. If its the same as the captured
    index then we know that it was the captured CharProc threw an error.
    
    In the case of this kind of error we simply return the error, there is
    nothing further we can do.

devices/vector/gdevpdtt.c



Ghostscript:

new scan-build warnings:

./devices/vector/gdevpdtt.c:2912:37: warning: Dereference of null pointer
        pdev->substream_Resources = pdfont->u.simple.s.type3.Resources;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./devices/vector/gdevpdtt.c:3102:9: warning: 'code' may be used uninitialized in this function [-Wmaybe-uninitialized]
     int code, early_accumulator = 0;
         ^


http://miles.ghostscript.com:8080/artifex/2f017502459778cac3c2b8cb2c6df2f52629aae3/gs/index.html

http://miles.ghostscript.com:8080/artifex/2f017502459778cac3c2b8cb2c6df2f52629aae3/gs-scan-build.txt




GhostPCL:

new scan-build warnings:

./devices/vector/gdevpdtt.c:2912:37: warning: Dereference of null pointer
        pdev->substream_Resources = pdfont->u.simple.s.type3.Resources;
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./devices/vector/gdevpdtt.c:3102:9: warning: 'code' may be used uninitialized in this function [-Wmaybe-uninitialized]
     int code, early_accumulator = 0;
         ^


http://miles.ghostscript.com:8080/artifex/2f017502459778cac3c2b8cb2c6df2f52629aae3/pcl/index.html

http://miles.ghostscript.com:8080/artifex/2f017502459778cac3c2b8cb2c6df2f52629aae3/pcl-scan-build.txt