You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GH-49896: [C++] Reject short buffer reads in IPC reader (#49897)
### Rationale for this change
IO methods like `ReadAt` can return less bytes than asked for if the file is too short, but the IPC reader doesn't always detect for this situation. On invalid IPC files, this can produce issues down the road such as half-initialized buffers and large processing times (with a potential denial of service).
This issue was detected by OSS-Fuzz: https://issues.oss-fuzz.com/issues/489758017
### What changes are included in this PR?
1. Add `ReadAt` and `ReadAsync` overloads that accept a `bool allow_short_read` argument
2. Pass `allow_short_read = false` in all suitable places in IPC and Parquet readers
### Are these changes tested?
Yes, by existing tests and new fuzz regression file.
### Are there any user-facing changes?
No, except potentially better detection of invalid IPC streams and files.
* GitHub Issue: #49896
Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
0 commit comments