[Poppler-bugs] [Bug 27728] pdftops gets "Error: Illegal entry in bfrange block in ToUnicode CMap"

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Apr 21 11:36:29 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=27728

--- Comment #7 from William Bader <williambader at hotmail.com> 2010-04-21 11:36:29 PDT ---
The replacement

-       if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
-             n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>')) {
+       if (!(((n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>') ||
+              (n1 == 4 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
tok1[1] == '0' && tok1[2] == '0')) &&
+             ((n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>') ||
+              (n2 == 4 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>' &&
tok1[1] == '0' && tok1[2] == '0')))) {

is what stops the "Illegal entry in bfrange block in ToUnicode CMap" error.
Five places in CharCodeToUnicode.cc printed the identical error message.
To figure out which of the five places was causing the problem, I added some
identifying text to the end of each message.
I left the changed messages in my patch.
In some of the messages, I also printed the tokens that caused the error, for
example,
-         error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
+         error(-1, "Illegal entry in bfrange block in ToUnicode CMap, found
'%s' '%s'", tok1, tok2);
Printing the token is a security hole because it passes unfiltered user data to
the screen.  For example, if the message goes to an xterm, it might be possible
to write an invalid pdf where the data in the tok1 string in the error message
makes the xterm run a command by using these codes
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list