[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1767-gd31e25e

[email protected] (Julian Smith) Tue, 29 Oct 2019 14:52:14 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  d31e25ed5b130499e0d880e4609b1b4824699768 (commit)
      from  6e6c69487094b877bc56fcc07b9840f6e5b95925 (commit)

----------------------------------------------------------------------
commit d31e25ed5b130499e0d880e4609b1b4824699768
Author: Julian Smith <[email protected]>
Date:   Tue Oct 29 14:13:25 2019 +0000

    Bug 701788: include space for string terminator in call to malloc in cif_print_page().
    
    Fixes ./sanbin/gs -sOutputFile=tmp -sDEVICE=cif ../bug-701788.pdf

diff --git a/devices/gdevcif.c b/devices/gdevcif.c
index f67aaf2..bd9649a 100644
--- a/devices/gdevcif.c
+++ b/devices/gdevcif.c
@@ -58,12 +58,12 @@ cif_print_page(gx_device_printer *pdev, gp_file *prn_stream)
                 length = strlen(pdev->fname) + 1;
         else
                 length = s - pdev->fname;
-        s = (char *)gs_malloc(pdev->memory, length, sizeof(char), "cif_print_page(s)");
+        s = (char *)gs_malloc(pdev->memory, length+1, sizeof(char), "cif_print_page(s)");
 
         strncpy(s, pdev->fname, length);
         *(s + length) = '\0';
         gp_fprintf(prn_stream, "DS1 25 1;\n9 %s;\nLCP;\n", s);
-        gs_free(pdev->memory, s, length, 1, "cif_print_page(s)");
+        gs_free(pdev->memory, s, length+1, 1, "cif_print_page(s)");
 
    for (lnum = 0; lnum < pdev->height; lnum++) {
       gdev_prn_copy_scan_lines(pdev, lnum, in, line_size);


Summary of changes:
 devices/gdevcif.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)