소스 검색

Fix container overflow in MMD parser

Using reserve, buffer size is not updated. Since data is directly inserted and not using push_pack,
this can lead to a container overflow.
Alexandre Avenel 2 년 전
부모
커밋
aae93691b9
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      code/AssetLib/MMD/MMDPmxParser.cpp

+ 1 - 1
code/AssetLib/MMD/MMDPmxParser.cpp

@@ -93,7 +93,7 @@ namespace pmx
 		{
 			return std::string();
 		}
-		buffer.reserve(size);
+		buffer.resize(size);
 		stream->read((char*) buffer.data(), size);
 		if (encoding == 0)
 		{