Closed jefffisher closed 6 years ago
If a string data member is added to a packet with a default value, the default value is set, but then overwritten by bogus data after the end of the packet. As an example, I generated a packet encode function with this XML spec:
<Packet name="Test" ID="100"> <Data name="Field0" inMemoryType="unsigned32"/> </Packet>
Then I generated the decode function using this spec:
<Packet name="Test" ID="100"> <Data name="Field0" inMemoryType="unsigned32"/> <Data name="Field1" inMemoryType="string" array="32" default="test"/> </Packet>
The results can be seen here, including a fixed decode function: https://repl.it/@jefffisher/ChiefAwareMonotone
Fixed in 2.14.d. I just never implemented the intended logic.
If a string data member is added to a packet with a default value, the default value is set, but then overwritten by bogus data after the end of the packet. As an example, I generated a packet encode function with this XML spec:
Then I generated the decode function using this spec:
The results can be seen here, including a fixed decode function: https://repl.it/@jefffisher/ChiefAwareMonotone