[gs-commits] ghostpdl branch, master, updated. ghostpdl-9.02-641-gf790680

Alex Cherepanov alexcher at ghostscript.com
Sun Oct 9 05:52:19 UTC 2011


The ghostpdl branch, master has been updated
       via  f790680acba5c1574728d5ff40124f9e27762d2a (commit)
      from  c760cef454473970972260b5b1c7ab078711e43d (commit)

----------------------------------------------------------------------
commit f790680acba5c1574728d5ff40124f9e27762d2a
Author: Alex Cherepanov <alex.cherepanov at artifex.com>
Date:   Sun Oct 9 01:10:38 2011 -0400

    Bug 692571: Fix ouf-of-buffer access in Luratech jb2 interface.
    
    Luratech jb2 library can requiet data outside of the input buffer
    if it is fed a corrupted data stream. The old code tried to detect
    this but failed because of the missed signed-to-unsighed promotion.

diff --git a/gs/base/sjbig2_luratech.c b/gs/base/sjbig2_luratech.c
index 2e80db5..4473581 100644
--- a/gs/base/sjbig2_luratech.c
+++ b/gs/base/sjbig2_luratech.c
@@ -188,9 +188,11 @@ s_jbig2_read(unsigned char *buffer,
 
     /* else return data from the image stream */
     offset -= state->global_size;
+    if (state->infill <= offset)
+        return 0;
     available = state->infill - offset;
-    if (available > size) available = size;
-    if (available <= 0) return 0;
+    if (available > size)
+        available = size;
 
     memcpy(buffer, state->inbuf + offset, available);
     return available;


Summary of changes:
 gs/base/sjbig2_luratech.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)



More information about the gs-commits mailing list