Fixes Heap-buffer-overflow READ 1 in Assimp::MD5::MD5Parser::ParseHeader

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49422
When it reaches the `SkipSpacesAndLineEnd`, `in` already points past `bufferEnd` and it leads to out of bounds memory read.
pull/4837/head
Alex 2022-12-11 00:02:09 +00:00 committed by GitHub
parent 0fdae2879d
commit 90769ef3e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -117,6 +117,8 @@ void MD5Parser::ParseHeader() {
ReportError("MD5 version tag is unknown (10 is expected)"); ReportError("MD5 version tag is unknown (10 is expected)");
} }
SkipLine(); SkipLine();
if (buffer == bufferEnd)
return;
// print the command line options to the console // print the command line options to the console
// FIX: can break the log length limit, so we need to be careful // FIX: can break the log length limit, so we need to be careful