Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2688

prefixed length field when not enough bits available gives Runtime SDE not parse error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.0
    • 3.7.0
    • Back End
    • None

    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. 

       

      Attachments

        Activity

          People

            mbeckerle Mike Beckerle
            mbeckerle Mike Beckerle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: