Bug 97449 - PDFDoc::setDocInfoStringEntry() should treat value consisting of just the unicode marker as an empty string
Summary: PDFDoc::setDocInfoStringEntry() should treat value consisting of just the uni...
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-23 11:28 UTC by Jakub Alba
Modified: 2016-10-23 21:02 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
[PATCH 1/2] goo: add GooString::hasJustUnicodeMarker(void) (1.23 KB, patch)
2016-08-23 11:29 UTC, Jakub Alba
Details | Splinter Review
[PATCH 2/2] PDFDoc::setDocInfoStringEntry(): treat value consisting of just the unicode marker as an empty string (843 bytes, patch)
2016-08-23 11:29 UTC, Jakub Alba
Details | Splinter Review
[PATCH 1/2] goo: add GooString::hasJustUnicodeMarker(void) (1.22 KB, patch)
2016-10-22 18:44 UTC, Jakub Alba
Details | Splinter Review
[PATCH 2/2] PDFDoc::setDocInfoStringEntry(): treat value consisting of just the unicode marker as an empty string (832 bytes, patch)
2016-10-22 18:45 UTC, Jakub Alba
Details | Splinter Review

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.