dopelsunce opened a new issue, #3279:
URL: https://github.com/apache/arrow-rs/issues/3279

   The following code panics:
   
   ```
   let data = [255, 172, 1, 0, 50, 82, 65, 73, 1, 0, 0, 0, 169, 168, 168, 162, 
87, 255, 16, 0, 0, 0, 80, 65, 82, 49];
   let chunk_reader = bytes::Bytes::copy_from_slice(&data);
   let _ = SerializedFileReader::new(chunk_reader);
   ```
   
   stack trace:
   
   ```
   thread 'tests::test_reader' panicked at 'return value should have been 
constructed', 
/Users/yahuis/.cargo/registry/src/github.com-1ecc6299db9ec823/parquet-28.0.0/src/format.rs:4414:14
   stack backtrace:
      0: rust_begin_unwind
                at 
/rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
      1: core::panicking::panic_fmt
                at 
/rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
      2: core::panicking::panic_display
                at 
/rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:72:5
      3: core::panicking::panic_str
                at 
/rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:56:5
      4: core::option::expect_failed
                at 
/rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/option.rs:1874:5
      5: core::option::Option<T>::expect
                at 
/rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/option.rs:738:21
      6: <parquet::format::ColumnOrder as 
thrift::protocol::TSerializable>::read_from_in_protocol
                at 
/Users/yahuis/.cargo/registry/src/github.com-1ecc6299db9ec823/parquet-28.0.0/src/format.rs:4414:10
      7: <parquet::format::FileMetaData as 
thrift::protocol::TSerializable>::read_from_in_protocol
                at 
/Users/yahuis/.cargo/registry/src/github.com-1ecc6299db9ec823/parquet-28.0.0/src/format.rs:5158:32
      8: parquet::file::footer::decode_metadata
                at 
/Users/yahuis/.cargo/registry/src/github.com-1ecc6299db9ec823/parquet-28.0.0/src/file/footer.rs:74:42
      9: parquet::file::footer::parse_metadata
                at 
/Users/yahuis/.cargo/registry/src/github.com-1ecc6299db9ec823/parquet-28.0.0/src/file/footer.rs:67:5
     10: parquet::file::serialized_reader::SerializedFileReader<R>::new
                at 
/Users/yahuis/.cargo/registry/src/github.com-1ecc6299db9ec823/parquet-28.0.0/src/file/serialized_reader.rs:231:24
     11: fuzz_parquet::tests::test_reader
                at ./src/lib.rs:17:17
     12: fuzz_parquet::tests::test_reader::{{closure}}
                at ./src/lib.rs:13:5
     13: core::ops::function::FnOnce::call_once
                at 
/rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
     14: core::ops::function::FnOnce::call_once
                at 
/rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
   note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 
backtrace.
   ```
   
   **Expected behavior**
   
   I expect `SerializedFileReader::new()` to return an `Err` result, when the 
input data is corrupted.
   
   **Additional context**
   
   Found by cargo-fuzz.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to