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

GenericSingleObjectReader::read_value fails on non-exhaustive read

    XMLWordPrintableJSON

Details

    Description

      There is a bug in the Rust implementation of GenericSingleObjectReader::read_value, which is exposed when a call to reader.read reads less than 10 bytes. This is a valid scenario, as according to the documentation of Read::read, "It is not an error if the returned value n is smaller than the buffer size, even when the reader is not at the end of the stream yet." This is also a real-life scenario: in my use-case, I am chaining three implementations of the Read trait to messages that can be deserialized (one for the two magic bytes, one for the schema fingerprint, and one for the actual message content). Each call to Read::read only returns the bytes of one chain link, so the first call to Read::read only returns 2 bytes.

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              dpeklak David Peklak
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m