Closed tustvold closed 1 year ago
Noticed whilst working on #1446
OffsetBuffer::slice does not verify that the length is non-zero, which results in UB from methods such as OffsetBuffer::first
OffsetBuffer::slice
#[test] fn test_offsets_slice() { let mut buffer = OffsetsBuffer::<i32>::new(); buffer.slice(0, 0); buffer.first(); }
Fails in debug with
process didn't exit successfully: `/home/raphael/repos/external/arrow2/target/debug/deps/it-04058e53dc1ec684 'array::utf8::test_offsets_slice' --format=json --exact -Z unstable-options --show-output` (signal: 4, SIGILL: illegal instruction)
Good catch! Fixed in #1448
Thank you for reporting it. Well spotted - I plan to cut a release with a fix for this as well as adding an entry to the rust advisory.
Noticed whilst working on #1446
OffsetBuffer::slice
does not verify that the length is non-zero, which results in UB from methods such as OffsetBuffer::firstFails in debug with