Skip to content

Commit

Permalink
Engine: small safety fix for ScriptString::Unserialize()
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-mogilko committed Oct 31, 2023
1 parent c4a26ef commit ebe3999
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Engine/ac/dynobj/scriptstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ void ScriptString::Unserialize(int index, Stream *in, size_t /*data_sz*/)
Header &hdr = reinterpret_cast<Header&>(*buf);
hdr.Length = len;
hdr.ULength = ustrlen(text_ptr);
hdr.LastCharIdx = 0u;
hdr.LastCharOff = 0u;
ccRegisterUnserializedObject(index, text_ptr, this);
}

Expand Down

0 comments on commit ebe3999

Please sign in to comment.