mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 04:55:21 +02:00
![]() (https://github.com/ruby/strscan/pull/153)
Fix https://github.com/ruby/strscan/pull/152
CRuby can walk off the end because there's always a null byte. In JRuby,
the byte array is often (usually?) the exact size of the string. So we
need to check if len++ walked off the end.
This code was ported from a version by @byroot in
https://github.com/ruby/strscan/pull/127 but I missed adding this check
due to a lack of tests. A test is included for both "-" and "+" parsing.
|
||
---|---|---|
.. | ||
test_ractor.rb | ||
test_stringscanner.rb |