Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bounds checking in MutableBuffer::set_null_bits can be bypassed #4620

Closed
kawadakk opened this issue Aug 2, 2023 · 1 comment · Fixed by #4621
Closed

Bounds checking in MutableBuffer::set_null_bits can be bypassed #4620

kawadakk opened this issue Aug 2, 2023 · 1 comment · Fixed by #4621
Labels
arrow Changes to the arrow crate bug

Comments

@kawadakk
Copy link
Contributor

kawadakk commented Aug 2, 2023

Describe the bug
Bounds checking in MutableBuffer::set_null_bits can be bypassed by supplying input parameters that would cause integer overflow, breaking the safety guarantees.

To Reproduce

fn main() {
    let mut buf = arrow::buffer::MutableBuffer::new(0);
    buf.set_null_bits(1, usize::MAX);
}
$ cargo run --release --quiet
fish: Job 2, 'cargo run --release --quiet' terminated by signal SIGSEGV (Address boundary error)

Expected behavior
Avoiding undefined behaviour by panicking, aborting, or silently saturating a given range.

Additional context

@tustvold
Copy link
Contributor

label_issue.py automatically added labels {'arrow'} from #4621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants