-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
schema:
table TestTable
{
string_vector:[string];
}
test code:
var table = new TestTableT();
table.StringVector = new List<string>();
table.StringVector.Add(null);
var data = table.SerializeToBinary();
var table2 = TestTableT.DeserializeFromBinary(data);
exception:
ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Google.FlatBuffers.ByteBuffer.AssertOffsetAndLength (System.Int32 offset, System.Int32 length)
Google.FlatBuffers.ByteBuffer.ReadLittleEndian (System.Int32 offset, System.Int32 count)
Google.FlatBuffers.ByteBuffer.GetInt (System.Int32 index)
Google.FlatBuffers.Table.__string (System.Int32 offset)
TestTable.StringVector (System.Int32 j)
TestTable.UnPackTo (ExcelData.TestTableT _o)
TestTable.UnPack ()
TestTableT.DeserializeFromBinary (System.Byte[] fbBuffer)
issue:
Zero offset is not handled in FlatBufferBuilder.AddOffset, when creating vector. Zero offset is treated as relative offset to current position. So it's value can't be correctly unpacked.