INDEX: compare the result size with saturating u64 math, so it can't overflow on 32-bit targets (review fix-up for #400)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
fbb2285532
commit
fca801c17e
|
|
@ -1112,7 +1112,7 @@ impl<'h> Evaluator<'h> {
|
|||
};
|
||||
let (ra, ca) = (as_array(&rows), as_array(&cols));
|
||||
let (h, w) = (ra.rows.max(ca.rows), ra.cols.max(ca.cols));
|
||||
if (h * w) as u64 > MAX_CELLS {
|
||||
if (h as u64).saturating_mul(w as u64) > MAX_CELLS {
|
||||
return err(CellError::Num);
|
||||
}
|
||||
let mut out = Vec::with_capacity(h * w);
|
||||
|
|
|
|||
Loading…
Reference in New Issue