Description
When a prefixed length, let's say a 4-byte unsigned int, is being parsed, and there are not 32-bits available (because, for example you are at end of data), then you don't get a parse error. Instead you get:
Runtime Schema Definition Error: Prefixed length result must be non-negative after dfdl:prefixIncludesPrefixLength adjustment , but was: -4
This needs to be a parse error due to the insufficient bits.
If you trace, you get this:
parser: <BinaryIntegerKnownLengthParser/> bitPosition: 1920 data: │ │ 87654321 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789abcdef infoset: <?xml version="1.0" encoding="UTF-8"?> <message (prefixLength)></message (prefixLength)> diff: (no differences) failure: Parse Error: Insufficient bits in data. Needed 32 bit(s) but found only 0 available. Schema context: message (prefixLength) Location line 385 in file:/....../common.dfdl.xsd Data location was preceding byte 240 limit(bytes) 240 ----------------------------------------------------------------- 347org.apache.daffodil.tdml.TDMLExceptionImpl: (Implementation: daffodil) Runtime Schema Definition Error: Prefixed length result must be non-negative after dfdl:prefixIncludesPrefixLength adjustment , but was: -4
So you can see how it's just out of data, yet getting an RSDE on this.