Bug 688911

Summary: Valgrind: Uninitialized data in pdf_put_name_chars_1_2()
Product: Ghostscript Reporter: Alex Cherepanov <alex>
Component: PDF WriterAssignee: Default assignee <ghostpdl-bugs>
Status: NOTIFIED FIXED    
Severity: normal    
Priority: P4    
Version: master   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: patch
patch

Description Alex Cherepanov 2006-09-23 19:32:24 UTC
File: Bug687698.ps - pdfwrite

Conditional jump or move depends on uninitialised value(s)
   at 0x8204431: pdf_put_name_chars_1_2 (gdevpdfu.c:1401)
   by 0x820450A: pdf_put_name_chars (gdevpdfu.c:1432)
   by 0x8204549: pdf_put_name (gdevpdfu.c:1438)
   by 0x821FDD3: pdf_write_font_resource (gdevpdtw.c:580)
   by 0x821FF02: write_font_resources (gdevpdtw.c:618)
   by 0x821FFFF: pdf_close_text_document (gdevpdtw.c:657)
   by 0x81E5D1D: pdf_close (gdevpdf.c:1093)
   by 0x824605D: gs_closedevice (gsdevice.c:505)
   by 0x80B30AA: gs_main_finit (imain.c:772)
   by 0x80B33BE: gs_to_exit_with_code (imain.c:824)
   by 0x804AFD6: main (gs.c:119)
Comment 1 Alex Cherepanov 2006-09-25 21:39:12 UTC
Created attachment 2510 [details]
patch

Fix off-by-one error in the PDF font subset prefix generator that
mixed in an uninitialised byte when the object size was odd. This error
caused indeterministic PDF generation and Valgrind warnings.
Comment 2 Alex Cherepanov 2006-09-26 04:26:23 UTC
*** Bug 688913 has been marked as a duplicate of this bug. ***
Comment 3 Alex Cherepanov 2006-09-26 05:19:15 UTC
Created attachment 2511 [details]
patch

A better hash function that doesn't depend on the size of short or
big/little-endian architecture.
Comment 4 leonardo 2006-10-04 04:56:17 UTC
Please commit the patch 2511.
Comment 5 Alex Cherepanov 2006-10-04 05:32:02 UTC
The patch 2511 is committed as rev. 7081.