Skip to content

Commit

Permalink
Fix container overflow in MMD parser
Browse files Browse the repository at this point in the history
Using reserve, buffer size is not updated. Since data is directly inserted and not using push_pack,
this can lead to a container overflow.
  • Loading branch information
Alexandre Avenel authored and kimkulling committed Nov 17, 2023
1 parent 6004290 commit aae9369
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/AssetLib/MMD/MMDPmxParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace pmx
{
return std::string();
}
buffer.reserve(size);
buffer.resize(size);
stream->read((char*) buffer.data(), size);
if (encoding == 0)
{
Expand Down

0 comments on commit aae9369

Please sign in to comment.