David Peklak created AVRO-3642:
----------------------------------

             Summary: GenericSingleObjectReader::read_value fails on 
non-exhaustive read
                 Key: AVRO-3642
                 URL: https://issues.apache.org/jira/browse/AVRO-3642
             Project: Apache Avro
          Issue Type: Bug
          Components: rust
            Reporter: David Peklak


There is a bug in the Rust implementation of 
[GenericSingleObjectReader::read_value|https://docs.rs/apache-avro/0.14.0/apache_avro/struct.GenericSingleObjectReader.html#method.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|https://doc.rust-lang.org/std/io/trait.Read.html#tymethod.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.



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

Reply via email to