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

robin at ghostscript.com robin at ghostscript.com
Wed Oct 6 14:03:34 UTC 2010


Author: robin
Date: 2010-10-06 14:03:32 +0000 (Wed, 06 Oct 2010)
New Revision: 11764

Modified:
   trunk/gs/base/gxclist.c
Log:
Fix for part 2 of Bug 691484, valgrind warnings about uninitialised values
in clist code.

The problem is that we are writing out a cmd_block without initialising it all.
The fix is simply to initialise it (using a memset, so accounting for all
padding bytes too) before starting to use it.

This stops the valgrind warnings. No changes in localcluster testing.




Modified: trunk/gs/base/gxclist.c
===================================================================
--- trunk/gs/base/gxclist.c	2010-10-06 13:48:15 UTC (rev 11763)
+++ trunk/gs/base/gxclist.c	2010-10-06 14:03:32 UTC (rev 11764)
@@ -793,6 +793,7 @@
 	 * Write the terminating entry in the block file.
 	 * Note that because of copypage, there may be many such entries.
 	 */
+        memset(&cb, 0, sizeof(cb)); /* Zero the block, including any padding */
 	cb.band_min = cb.band_max = cmd_band_end;
 	cb.pos = (cldev->page_cfile == 0 ? 0 : cldev->page_info.io_procs->ftell(cldev->page_cfile));
 	code = cldev->page_info.io_procs->fwrite_chars(&cb, sizeof(cb), cldev->page_bfile);



More information about the gs-commits mailing list