Skip to content
  • Alan Wu's avatar
    9786b909
    Fix regex match cache out-of-bounds access · 9786b909
    Alan Wu authored
    Previously the following read and wrote 1 byte out-of-bounds:
    
        $ valgrind ruby -e 'p /(\W+)[bx]\?/i.match? "aaaaaa aaaaaaaaa aaaa aaaaaaaa aaa aaaaxaaaaaaaaaaa aaaaa aaaaaaaaaaaa a ? aaa aaaa a ?"' 2> >(grep Invalid -A 30)
    
    Because of the `match_cache_point_index + 1` in
    memoize_extended_match_cache_point() and
    check_extended_match_cache_point(), we need one more byte of space.
    9786b909
    Fix regex match cache out-of-bounds access
    Alan Wu authored
    Previously the following read and wrote 1 byte out-of-bounds:
    
        $ valgrind ruby -e 'p /(\W+)[bx]\?/i.match? "aaaaaa aaaaaaaaa aaaa aaaaaaaa aaa aaaaxaaaaaaaaaaa aaaaa aaaaaaaaaaaa a ? aaa aaaa a ?"' 2> >(grep Invalid -A 30)
    
    Because of the `match_cache_point_index + 1` in
    memoize_extended_match_cache_point() and
    check_extended_match_cache_point(), we need one more byte of space.
Loading