maltzsama opened a new issue, #182:
URL: https://github.com/apache/arrow-swift/issues/182

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   ### Description
   
   `ArrowReader.readStreaming()`, `ArrowReader.readFile()`, and 
`ArrowReader.fromMessage()` crash with fatal errors when processing malformed 
or truncated Arrow files instead of returning error results.
   
   ### Root Cause
   
   Multiple locations in the reader use force unwrap (`!`) on optional values 
that can be nil when input is malformed:
   
   1. **readStreaming** (line 285-289): Assumes `schemaMessage` and 
`result.schema` exist before using them
   2. **readFile** (line 338, 374-375): Assumes `footer.schema` and 
`result.schema` exist without checking
   3. **fromMessage** (line 436): Assumes `result.messageSchema` and 
`result.schema` exist
   
   When these values are nil (due to missing/malformed schema, missing 
recordbatch header, etc.), the force unwrap causes a crash instead of returning 
a `.failure` result.
   
   ### Example Triggers
   
   - RecordBatch message without preceding Schema message
   - Truncated file missing footer schema
   - Malformed message headers
   
   ### Expected Behavior
   
   All malformed input should gracefully return `ArrowError` rather than 
crashing the application.
   
   ### Affected Methods
   
   - `readStreaming(_:useUnalignedBuffers:)`
   - `readFile(_:useUnalignedBuffers:)`
   - `fromMessage(_:dataBody:result:useUnalignedBuffers:)`


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