TransferableGraphFileReader may overrun ByteFileReader's internal buffer
|Assignee:||Tuukka Lehtonen||% Done:|
|Category:||-||Spent time:||2.00 hours|
|Velocity based estimate||-|
|Release||Simantics 1.13.3||Release relationship||Auto|
A diagram TG export revealed the following bugs in TransferableGraphFileReader.readTG:
- The identify reading loop can take a path which read two times in a row from the internal reading buffer without checking whether there is still data or not.
- Reading does not take into account that the TGs can contain strings that are longer than 127 characters and that the length of the string is actually encoded as a dynamic 32-bit integer whose physical length can vary between 1-5 bytes depending on the value.
- Fixed modified UTF-8 string reading array buffer overrun bug from TransferableGraphFileReader
- Added getDynamicUInt32 to ByteFileReader to faciliate the fix (copied from class org.simantics.databoard.util.binary.Endian)
- Better debug prints for UnescapedChildMapOfResource