You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VT parser rejects a pool that ends with an empty Data Mask or Working Set #950
parse_next_object() checks iopLength >= tempObject->get_minumum_object_length() before it reads an object. For two object types, the minimum is larger than the fixed part the parser then reads:
Object
Fixed part read by parse_next_object()
MIN_OBJECT_LENGTH
Data Mask
8 bytes (ID, type, background colour, Soft Key Mask, number of objects, number of macros); it then does iopLength -= 8
12
Working Set
10 bytes (ID, type, background colour, selectable, active mask, number of objects, number of macros, number of languages); it then does iopLength -= 10
16
So a Data Mask without objects and macros is 8 bytes long. If it is the last object of a transfer, fewer bytes than the minimum are left, and the whole pool is rejected with the Data Mask as the faulting object, although it is valid. In the middle of a pool it goes unnoticed, because the following objects make up the difference.
Edit: for the Working Set this only matters for a Working Set without objects, which isn't valid (ISO 11783-6:2018 B.1 and Table B.2 require at least one object). A valid Working Set is at least 16 bytes, so only the Data Mask is affected in practice. The Working Set guard should still match the 10 bytes the parser reads.
To reproduce
Parse { 0x00, 0x00, 0x00, 0x00, 0x01, 0xE8, 0x03, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x01, 0x00, 0xFF, 0xFF, 0x00, 0x00 } (Working Set 0 with active mask 1000, then an empty Data Mask 1000): parsing fails with faulting object 1000. (The Working Set in this pool has no objects, which isn't valid; with one object it fails the same way because of the Data Mask.)
StatusMessageReportsTheNewAddressOfTheActiveWorkingSetMaster (from #936) uploads exactly the first pool. It only passes today because a failed parse leaves the objects parsed so far in the tree; #949 changes that.
Fix
Set DataMask::MIN_OBJECT_LENGTH to 8 and WorkingSet::MIN_OBJECT_LENGTH to 10. Both values come from the first version of the object classes. The other object types match the fixed part their parser reads.
Activity
Accept an empty Data Mask or Working Set at the end of a transfer (Op…