Actions
Bug #22325
closedout of bounds read in array
Bug #22325:
out of bounds read in array
Description
Hi, an OOB read seems possible in array
class bad < Numeric
def initialize(v); @v = v; end
def val; @v; end
def <=>(o); @v <=> (o.is_a?(bad) ? o.val : o); end
def to_int; $a.clear; @v; end
def to_i; @v; end
def coerce(o); [o, @v]; end
end
$a = (1..3000).to_a
seq = Range.new(bad.new(2900), bad.new(2950)).step(2)
asan output (truncated):
Updated by eightbitraptor (Matt V-H) 6 days ago
- Status changed from Open to Closed
Applied in changeset git|8befacf9e6c898a0f79dcb53bdd2e4cea24e0d1c.
Guard against oob read in rb_ary_aref1
When the array is shrunk during rb_arithmetic_sequence_beg_len_step,
ary_subseq_len returns -1. Return an empty array instead of passing the
negative length to ary_make_partial or ary_make_partial_step.
[Bug #22325]
Actions