Browse Source

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.
Alex 2 years ago
parent
commit
90769ef3e6
1 changed files with 2 additions and 0 deletions
  1. 2 0
      code/AssetLib/MD5/MD5Parser.cpp

+ 2 - 0
code/AssetLib/MD5/MD5Parser.cpp

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