summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Figuière <hub@figuiere.net>2018-02-25 14:06:52 -0500
committerHubert Figuière <hub@figuiere.net>2018-02-25 14:06:52 -0500
commita839fcef62c088d7fe96c02e75b44317c55e93d0 (patch)
tree0a9ecd860701466475e318ea9565aa4a34611a68
parent95c874f7f30ffae441cdb7f78e47d65cab52c354 (diff)
Bug 105206 - Cosmetic fixes to the bug fix
-rw-r--r--XMPFiles/source/FileHandlers/PostScript_Handler.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/XMPFiles/source/FileHandlers/PostScript_Handler.cpp b/XMPFiles/source/FileHandlers/PostScript_Handler.cpp
index 9ed0071..81b6928 100644
--- a/XMPFiles/source/FileHandlers/PostScript_Handler.cpp
+++ b/XMPFiles/source/FileHandlers/PostScript_Handler.cpp
@@ -885,9 +885,13 @@ void PostScript_MetaHandler::ParsePSFile()
if (CheckBytes ( ioBuf.ptr, Uns8Ptr("iler"), 4 ))
{
ioBuf.ptr+=4;
+ // See bug https://bugs.freedesktop.org/show_bug.cgi?id=105206
+ // Ensure we don't get past the limit if
+ // the data is bogus.
while(ioBuf.ptr < ioBuf.limit &&
- !IsNewline(*ioBuf.ptr))
- ++ioBuf.ptr;
+ !IsNewline(*ioBuf.ptr)) {
+ ++ioBuf.ptr;
+ }
setTokenInfo(kPS_Trailer,begStartpos,ioBuf.filePos+ioBuf.ptr-ioBuf.data-begStartpos);
}
}