소스 검색

Fix stack-overflow in MDLLoader

- Use correct len to copy filename.
- Closes https://github.com/assimp/assimp/issues/4447
Kim Kulling 3 년 전
부모
커밋
c2b05acaa6
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      code/AssetLib/MDL/MDLMaterialLoader.cpp

+ 1 - 1
code/AssetLib/MDL/MDLMaterialLoader.cpp

@@ -493,7 +493,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7(
         size_t iLen2 = iLen + 1;
         iLen2 = iLen2 > MAXLEN ? MAXLEN : iLen2;
         memcpy(szFile.data, (const char *)szCurrent, iLen2);
-        szFile.length = (ai_uint32)iLen;
+        szFile.length = static_cast<ai_uint32>(iLen2);
 
         szCurrent += iLen2;