Răsfoiți Sursa

Fix integer overflow

Alex 2 ani în urmă
părinte
comite
edb8375702
1 a modificat fișierele cu 4 adăugiri și 0 ștergeri
  1. 4 0
      code/AssetLib/SMD/SMDLoader.cpp

+ 4 - 0
code/AssetLib/SMD/SMDLoader.cpp

@@ -840,6 +840,10 @@ void SMDImporter::ParseNodeInfo(const char* szCurrent, const char** szCurrentOut
         LogErrorNoThrow("Unexpected EOF/EOL while parsing bone index");
         LogErrorNoThrow("Unexpected EOF/EOL while parsing bone index");
         SMDI_PARSE_RETURN;
         SMDI_PARSE_RETURN;
     }
     }
+    if (iBone == UINT_MAX) {
+        LogErrorNoThrow("Invalid bone number while parsing bone index");
+        SMDI_PARSE_RETURN;
+    }
     // add our bone to the list
     // add our bone to the list
     if (iBone >= asBones.size()) {
     if (iBone >= asBones.size()) {
         asBones.resize(iBone+1);
         asBones.resize(iBone+1);