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

   **Describe the bug**
   
   `arrow-ipc` panics when reading an IPC file whose dictionary message omits 
its `data` field:
   
   ```
   thread panicked at arrow-ipc/src/reader.rs:
   called `Option::unwrap()` on a `None` value
   ```
   
   The stack is `FileReader::try_new` → `read_dictionary` → 
`read_dictionary_impl` → `get_dictionary_values`, where the field is opened 
with:
   
   ```rust
   let record_batch = RecordBatchDecoder::try_new(
       buf,
       batch.data().unwrap(),
       ...
   ```
   
   `DictionaryBatch.data` is optional in the flatbuffer grammar and required by 
the format, so a file that omits it is structurally decodable but semantically 
incomplete — and the reader panics rather than reporting it.
   
   **To Reproduce**
   
   A 2169-byte file from a fuzzing corpus; `FileReader::try_new` on it panics. 
I can attach the file, or reproduce it in a test.
   
   **Expected behavior**
   
   An `ArrowError`, not a panic — the same treatment the footer's custom 
metadata just received. `main` now does:
   
   ```rust
   let (Some(key), Some(value)) = (kv.key(), kv.value()) else {
       return Err(ArrowError::ParseError(
           "Custom metadata in the IPC footer is missing a key or a 
value".to_string(),
       ));
   };
   ```
   
   This is the same class of field in the same file, so the proposal is 
essentially "finish the round".
   
   **Additional context**
   
   Found by the fuzzing CI of 
[plenora-IO-tools](https://github.com/PlenoraETL/plenora-IO-tools). Present in 
59.3.0 (latest release) and re-read on `main` before filing.
   
   A panic matters more than usual under a fuzzer: `catch_unwind` turns it into 
an error, but under `libfuzzer-sys` a caught panic still becomes `abort()` 
before unwinding, so the target goes into quarantine.
   
   I have a patch and will open a PR referencing this issue. `take`


-- 
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