Bug 97449

Summary: PDFDoc::setDocInfoStringEntry() should treat value consisting of just the unicode marker as an empty string
Product: poppler Reporter: Jakub Alba <jakubalba>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: jakubalba
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: [PATCH 1/2] goo: add GooString::hasJustUnicodeMarker(void)
[PATCH 2/2] PDFDoc::setDocInfoStringEntry(): treat value consisting of just the unicode marker as an empty string
[PATCH 1/2] goo: add GooString::hasJustUnicodeMarker(void)
[PATCH 2/2] PDFDoc::setDocInfoStringEntry(): treat value consisting of just the unicode marker as an empty string

Description Jakub Alba 2016-08-23 11:28:25 UTC
A frontend like glib during string conversion from UTF8 to UTF16-BE inserts the unicode marker and when the input string is empty, then the output consists of just the unicode marker which prevents PDFDoc::setDocInfoStringEntry() from detecting that in reality it's an empty string. It may potentially occur in other places, so I think it should be fixed in PDFDoc::setDocInfoStringEnty(), not in the callers, since converting an empty string to just the unicode marker seems like a valid behavior to me and in a sense such a string is really empty.
Comment 1 Jakub Alba 2016-08-23 11:29:11 UTC
Created attachment 125971 [details] [review]
[PATCH 1/2] goo: add GooString::hasJustUnicodeMarker(void)
Comment 2 Jakub Alba 2016-08-23 11:29:41 UTC
Created attachment 125972 [details] [review]
[PATCH 2/2] PDFDoc::setDocInfoStringEntry(): treat value consisting of just the unicode marker as an empty string
Comment 3 Jakub Alba 2016-10-22 18:44:42 UTC
Created attachment 127474 [details] [review]
[PATCH 1/2] goo: add GooString::hasJustUnicodeMarker(void)
Comment 4 Jakub Alba 2016-10-22 18:45:29 UTC
Created attachment 127475 [details] [review]
[PATCH 2/2] PDFDoc::setDocInfoStringEntry(): treat value consisting of just the unicode marker as an empty string
Comment 5 Jakub Alba 2016-10-22 18:46:04 UTC
I've updated my name and e-mail in the commit author field.
Comment 6 Albert Astals Cid 2016-10-23 21:02:34 UTC
Pushed

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.