mirror of
https://github.com/ruby/ruby.git
synced 2026-01-29 21:44:28 +00: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. https://github.com/ruby/strscan/commit/1abe4ca556