[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1802-gaf00427

[email protected] (Julian Smith) Mon, 4 Nov 2019 16:50:09 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  af004276fd8f6c305727183c159b83021020f7d6 (commit)
      from  4f73e8b4d578e69a17f452fa60d2130c5faaefd6 (commit)

----------------------------------------------------------------------
commit af004276fd8f6c305727183c159b83021020f7d6
Author: Julian Smith <[email protected]>
Date:   Mon Nov 4 16:12:04 2019 +0000

    Bug 701829: ep_print_image(): protect against memcmp() beyond buffer.
    
    Fixes:
        ./sanbin/gs -dBATCH -dNOPAUSE -r12 -sOutputFile=tmp -sDEVICE=escp ../bug-701829.pdf

diff --git a/devices/gdevcdj.c b/devices/gdevcdj.c
index 8cf4e2e..1ab1c20 100644
--- a/devices/gdevcdj.c
+++ b/devices/gdevcdj.c
@@ -1969,7 +1969,7 @@ ep_print_image(gp_file *prn_stream, ep_globals *eg, char cmd, byte *data, int si
           /* p2 is the head of non zero image. */
           p2 = p3;
         redo:
-          for (p3 += row_bytes; memcmp(p3, zeros, row_bytes); p3 += row_bytes);
+          for (p3 += row_bytes; p3 < outp && memcmp(p3, zeros, row_bytes); p3 += row_bytes);
           if (p3 < outp && memcmp(p3+row_bytes, zeros, row_bytes)) goto redo;
         } else p1 = p2 = outp;
 


Summary of changes:
 devices/gdevcdj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)