Commit 1abe4ca
authored
jruby: Check if len++ walked off the end (#153)
Fix GH-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
#127 but I missed adding this check
due to a lack of tests. A test is included for both "-" and "+" parsing.1 parent a4afd32 commit 1abe4ca
File tree
2 files changed
+11
-1
lines changed- ext/jruby/org/jruby/ext/strscan
- test/strscan
2 files changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
592 | | - | |
| 592 | + | |
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
1004 | 1014 | | |
1005 | 1015 | | |
1006 | 1016 | | |
| |||
0 commit comments