Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stack-overflow in MDLLoader #4448

Merged
merged 1 commit into from
Mar 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix stack-overflow in MDLLoader
- Use correct len to copy filename.
- Closes #4447
  • Loading branch information
kimkulling authored Mar 16, 2022
commit c2b05acaa6f57cef04a6be3f875873f45ec76a7d
2 changes: 1 addition & 1 deletion code/AssetLib/MDL/MDLMaterialLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down