atharvalade opened a new pull request, #3165:
URL: https://github.com/apache/iggy/pull/3165

   ## Which issue does this PR close?
   
   Closes #3130
   
   ## Rationale
   
   `DeserializeStreams` and `DeserializeToStream` had zero bounds checking and 
no error propagation, causing silent data corruption for stream lists larger 
than 64KB.
   
   ## What changed?
   
   `DeserializeToStream` performed raw slice accesses without validating that 
the payload contained enough bytes for the 33-byte fixed header or the 
variable-length name. With large payloads (>64KB), any framing misalignment 
caused position drift—subsequent streams were deserialized from wrong offsets, 
silently returning corrupted data with no error.
   
   The fix adds bounds validation before every access in `DeserializeToStream` 
(returns error on insufficient data), propagates errors through 
`DeserializeStreams`, and updates the TCP caller. A new test file covers 
single-stream, multi-stream, truncated header/name, corrupted payload, 
max-length name, and a 70KB+ regression test that verifies every field of ~1000 
streams.
   
   ## Local Execution
   
   - Passed
   - Pre-commit hooks ran
   
   ## AI Usage
   
   1. Opus 4.6
   2. Minimal AI used
   3. All tests ran locally and pass; verified against the Rust wire format
   4. Yes, all code can be explained


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