Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1097

BinaryDecoder does not detect EOF sometimes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0
    • java
    • None

    Description

      This is the first problem reported in AVRO-1058.

      The trouble is, in case of end of stream, ensureBounds() does not really ensure that the requisite number of actual bytes are available in the buffer. It merely ensures that there won't be array index overflow. readInt() and readLong() check for overflow at the very end. But these two methods continue to read whatever bytes are in the buffer and interpret. If the bytes do not really belong to the stream (because of EOF), they need not be valid Zigzag encoding. That is the reason we get the "Invalid int encoding" exception.

      Attachments

        1. AVRO-1097-test.patch
          0.9 kB
          Thiruvalluvan M. G.
        2. AVRO-1097.patch
          0.5 kB
          Doug Cutting
        3. AVRO-1097.patch
          1 kB
          Thiruvalluvan M. G.

        Activity

          People

            thiru_mg Thiruvalluvan M. G.
            thiru_mg Thiruvalluvan M. G.
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: