poppler/PSTokenizer.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
New commits: commit 79a096a48c735ac301ae4d7439bddf630a559a96 Author: Vincent Le Garrec <[email protected]> Date: Thu Dec 21 00:57:48 2017 +0100 Fix index out of bounds undefined behaviour in PSTokenizer Bug #103583 diff --git a/poppler/PSTokenizer.cc b/poppler/PSTokenizer.cc index 05127f0d..ddde6bc1 100644 --- a/poppler/PSTokenizer.cc +++ b/poppler/PSTokenizer.cc @@ -15,6 +15,7 @@ // // Copyright (C) 2006 Scott Turner <[email protected]> // Copyright (C) 2008 Albert Astals Cid <[email protected]> +// Copyright (C) 2017 Vincent Le Garrec <[email protected]> // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -84,7 +85,7 @@ GBool PSTokenizer::getToken(char *buf, int size, int *length) { } } else if (c == '%') { comment = gTrue; - } else if (specialChars[c] != 1) { + } else if (specialChars[static_cast<unsigned char>(c)] != 1) { break; } } @@ -113,7 +114,7 @@ GBool PSTokenizer::getToken(char *buf, int size, int *length) { } else if (c == '<') { while ((c = lookChar()) != EOF) { consumeChar(); - if (i < size && specialChars[c] != 1) { + if (i < size && specialChars[static_cast<unsigned char>(c)] != 1) { buf[i++] = c; } if (c == '>') { @@ -121,7 +122,7 @@ GBool PSTokenizer::getToken(char *buf, int size, int *length) { } } } else if (c != '[' && c != ']') { - while ((c = lookChar()) != EOF && !specialChars[c]) { + while ((c = lookChar()) != EOF && !specialChars[static_cast<unsigned char>(c)]) { consumeChar(); if (i < size) { buf[i++] = c; _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
