Skip to content

Commit fb34da9

Browse files
committed
fix potential issue withing 0-length strings
#390
1 parent 81715b1 commit fb34da9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

game/game/serialize.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ uint32_t Serialize::implDirectorySize(std::string e) {
144144
}
145145

146146
void Serialize::writeBytes(const void* buf, size_t sz) {
147+
if(sz==0)
148+
return;
147149
size_t at = entryBuf.size();
148150
entryBuf.resize(entryBuf.size()+sz);
149151
std::memcpy(&entryBuf[at],buf,sz);

0 commit comments

Comments
 (0)