diff options
author | Hubert Figuière <hub@figuiere.net> | 2018-02-25 02:29:31 -0500 |
---|---|---|
committer | Hubert Figuière <hub@figuiere.net> | 2018-02-25 02:29:31 -0500 |
commit | baa4b8a02c1ffab9645d13f0bfb1c0d10d311a0c (patch) | |
tree | 35a335f4021231fa265fed9d3ba7d91aef10cc0c | |
parent | 6436fec3d478359587ea9049e926531212b14293 (diff) |
Bug 105206 - Fix a buffer overflow in the PS Handler
-rw-r--r-- | XMPFiles/source/FileHandlers/PostScript_Handler.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/XMPFiles/source/FileHandlers/PostScript_Handler.cpp b/XMPFiles/source/FileHandlers/PostScript_Handler.cpp index d21ab8d..9ed0071 100644 --- a/XMPFiles/source/FileHandlers/PostScript_Handler.cpp +++ b/XMPFiles/source/FileHandlers/PostScript_Handler.cpp @@ -885,7 +885,9 @@ void PostScript_MetaHandler::ParsePSFile() if (CheckBytes ( ioBuf.ptr, Uns8Ptr("iler"), 4 )) { ioBuf.ptr+=4; - while(!IsNewline(*ioBuf.ptr)) ++ioBuf.ptr; + while(ioBuf.ptr < ioBuf.limit && + !IsNewline(*ioBuf.ptr)) + ++ioBuf.ptr; setTokenInfo(kPS_Trailer,begStartpos,ioBuf.filePos+ioBuf.ptr-ioBuf.data-begStartpos); } } |