Actions
Bug #22638
closedOut-of-bounds read via stale MatchData char-offset cache
Bug #22638:
Out-of-bounds read via stale MatchData char-offset cache
Description
input = "abcdefgh"
big = /(.)(.)(.)(.)(.)(.)(.)(.)/
small = /(.)/
big =~ input
input.split(small, 2) { |s| Regexp.last_match.offset(1) if s.length == 1 }
m = big.match(input)
p (0..8).map { |i| m.offset(i) }
Expected::
Actual:
[[0, 1], [0, 1], [0, 33], [15180044, 281473212212120], [0, 65], [4294967298, 281473667944640], [281473211869520, 17179869185], [4, 187651108004256], [0, 337]]
Reported by: ProofHunt (https://hackerone.com/proofhunt)
Actions