Bug 691133

Summary: invalid output/error when creating XMP metadata from UTF-16 strings
Product: Ghostscript Reporter: Ken Sharp <ken.sharp>
Component: PDF WriterAssignee: Ken Sharp <ken.sharp>
Status: NOTIFIED FIXED    
Severity: normal    
Priority: P4    
Version: master   
Hardware: PC   
OS: Windows NT   
Customer: 1 Word Size: ---

Description Ken Sharp 2010-02-23 01:33:45 UTC
When manufacturing PDF/A output files we need to create XMP metadata. If the
metadata strings are UTF-16BE encoded, *and* a string contained a numeric, then
the decode_escape routine fails to correctly decode the octal values resulting
in garbage in the XMP metadata or (depending on the memory initialisation) an error.
Comment 1 Ken Sharp 2010-02-23 01:55:09 UTC
This was caused by the ridiculous assumption in the decode_escape routine that
octal escapes would always be terminated by a non-numeric character, and this
condition was used to terminate a loop. In fact escaped octal values should
always be three digits (or less!), and this limit is now what is used. The old
code consumed numeric values ad infinitum until a non-numeric character was
encountered.

Comment 2 Ken Sharp 2010-02-23 02:02:50 UTC
Fixed in revision 10785, patch here :

http://ghostscript.com/pipermail/gs-cvs/2010-February/010533.html
Comment 3 Marcos H. Woehrmann 2011-09-18 21:46:19 UTC
Changing customer bugs that have been resolved more than a year ago to closed.