Bug 691133 - invalid output/error when creating XMP metadata from UTF-16 strings
Summary: invalid output/error when creating XMP metadata from UTF-16 strings
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: master
Hardware: PC Windows NT
: P4 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-23 01:33 UTC by Ken Sharp
Modified: 2011-09-18 21:46 UTC (History)
0 users

See Also:
Customer: 1
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.