From 0accd84bfb94d43a9e3832f452100ede4bdabdfb Mon Sep 17 00:00:00 2001 From: bansan85 Date: Fri, 15 Dec 2017 20:18:25 +0100 Subject: [PATCH] Fix index out of bounds in PSTokenizer Bug #103583 --- poppler/PSTokenizer.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/poppler/PSTokenizer.cc b/poppler/PSTokenizer.cc index 05127f0d..c8859a87 100644 --- a/poppler/PSTokenizer.cc +++ b/poppler/PSTokenizer.cc @@ -84,7 +84,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(c)] != 1) { break; } } @@ -113,7 +113,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(c)] != 1) { buf[i++] = c; } if (c == '>') { @@ -121,7 +121,8 @@ 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(c)]) { consumeChar(); if (i < size) { buf[i++] = c; -- 2.15.1