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
{{ message }}
Repository navigation
[C++][IPC] Validate buffer bounds and replace raw pointer arithmetic in MessageDecoder #55669
In cpp/src/arrow/ipc, a few areas in streaming decoding and decompression can be made safer against invalid input buffers:
MessageDecoderImpl::ConsumeDataChunks in message.cc uses raw pointer offsets (static_cast<uint8_t*>(out) + offset) and manual memcpy increments across chunk buffers. We can replace this with arrow::util::span and check available chunk bytes before copying.
DecompressBuffer in reader.cc does not reject negative uncompressed sizes (uncompressed_size < -1) or cases where compressed_size == 0 && uncompressed_size > 0. We can also add an opt-in decompression ratio limit via IpcReadOptions (using MultiplyWithOverflow) for services reading untrusted streams.
Untrusted FlatBuffers tables call std::vector::reserve (e.g. in metadata_internal.cc) without checking if the declared count fits within the remaining buffer bytes.
Pass IpcReadOptions into MessageDecoder so streaming decoders can configure these limits.
Activity