Skip to content

Commit

Permalink
fix: avoid integer overflow in offsets_to_groups when bigidx is enabl…
Browse files Browse the repository at this point in the history
…ed (#11901)
  • Loading branch information
shenker authored Oct 22, 2023
1 parent d936f5c commit 7edac49
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions crates/polars-lazy/src/dsl/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ impl IntoListNameSpace for ListNameSpace {
fn offsets_to_groups(offsets: &[i64]) -> Option<GroupsProxy> {
let mut start = offsets[0];
let end = *offsets.last().unwrap();
let fits_into_idx = (end - start) <= IdxSize::MAX as i64;
if !fits_into_idx {
if IdxSize::try_from(end - start).is_err() {
return None;
}

let groups = offsets
.iter()
.skip(1)
Expand Down

0 comments on commit 7edac49

Please sign in to comment.