[gs-commits] rev 11765 - trunk/gs/base

ken at ghostscript.com ken at ghostscript.com
Thu Oct 7 07:49:13 UTC 2010


Author: ken
Date: 2010-10-07 07:49:13 +0000 (Thu, 07 Oct 2010)
New Revision: 11765

Modified:
   trunk/gs/base/gdevpdf.c
Log:
static analysis found that the result of fread was not being used. Add code to test the
result and flag a warning if expected data not read.

Modified: trunk/gs/base/gdevpdf.c
===================================================================
--- trunk/gs/base/gdevpdf.c	2010-10-06 14:03:32 UTC (rev 11764)
+++ trunk/gs/base/gdevpdf.c	2010-10-07 07:49:13 UTC (rev 11765)
@@ -1072,6 +1072,8 @@
 	    ulong pos;
 
 	    r = fread(&pos, sizeof(pos), 1, tfile);
+	    if (r != 1)
+		gs_note_error(gs_error_ioerror);
 	    if (pos & ASIDES_BASE_POSITION)
 		pos += resource_pos - ASIDES_BASE_POSITION;
 	    pos -= pdev->OPDFRead_procset_length;
@@ -1096,6 +1098,8 @@
 	    char str[21];
 
 	    r = fread(&pos, sizeof(pos), 1, tfile);
+	    if (r != 1)
+		gs_note_error(gs_error_ioerror);
 	    if (pos & ASIDES_BASE_POSITION)
 	        pos += resource_pos - ASIDES_BASE_POSITION;
 	    pos -= pdev->OPDFRead_procset_length;



More information about the gs-commits mailing list