Explorar o código

Merge pull request #3542 from ms-maxvollmer/fbx_tokenizer_fix

FBXBinaryTokenizer: Check length of property
Kim Kulling %!s(int64=4) %!d(string=hai) anos
pai
achega
3ccfc03c48
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      code/AssetLib/FBX/FBXBinaryTokenizer.cpp

+ 5 - 0
code/AssetLib/FBX/FBXBinaryTokenizer.cpp

@@ -375,6 +375,11 @@ bool ReadScope(TokenList& output_tokens, const char* input, const char*& cursor,
 
     // now come the individual properties
     const char* begin_cursor = cursor;
+
+    if ((begin_cursor + prop_length) > end) {
+        TokenizeError("property length out of bounds reading length ", input, cursor);
+    }
+
     for (unsigned int i = 0; i < prop_count; ++i) {
         ReadData(sbeg, send, input, cursor, begin_cursor + prop_length);