[ 
https://issues.apache.org/jira/browse/DAFFODIL-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dave Thompson closed DAFFODIL-2688.
-----------------------------------

Verified the specified commit (commit 4c61dc53bacc4dc6fb416512d8cef8b8a8a2c9bb) 
is included in the latest pull from the daffodil repository.

Verified, via review, changes identified in the ticket and commit comments were 
implemented. 

Verified the affected daffodil subproject sbt test suites executed 
successfully, including the added test.

Rolled commit back to pre-fix commit and executed the new test and verified 
that the identified RSDE occurred.

> prefixed length field when not enough bits available gives Runtime SDE not 
> parse error
> --------------------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2688
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2688
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>    Affects Versions: 3.3.0
>            Reporter: Mike Beckerle
>            Assignee: Mike Beckerle
>            Priority: Major
>             Fix For: 3.7.0
>
>
> 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:
> {code:java}
> Runtime Schema Definition Error: Prefixed length result must be non-negative 
> after dfdl:prefixIncludesPrefixLength adjustment , but was: -4 {code}
> This needs to be a parse error due to the insufficient bits. 
> If you trace, you get this:
> {code:java}
> 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 {code}
> So you can see how it's just out of data, yet getting an RSDE on this. 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to