RagingLightning/gvas-converter

Error when reading string property in object

Closed this issue · 1 comments

agc93 commented

I tried this out for parsing a save game, but had an exception when reading a string property inside an array. Since the call to UESerializer.Deserialize(null, ItemType, -1, reader) directly specified -1 as the valueLength, that gets passed all the way through to the ReadUEString(this BinaryReader reader, long vl) extension method and the -1 values causes an exception on line 39 since it's out of range.

From testing around, I found that changing UEStringProperty's constructor to the other overload worked fine:

-            Value = reader.ReadUEString(valueLength);
+           Value = reader.ReadUEString();

However, I'm not sure if that will break other things.

I never had a closer look at that code since it was part of the original project, but now that I look at it... why is it even there? The code is literally reading the value length itself...

Anyway, should be fixed now