Fix integer overflow; fix
The fix is suggested by
MODIFY
src/string.c
src/string.c
@@ -469,7 +469,7 @@ str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len)
beg += clen;
if (beg < 0) return mrb_nil_value();
}
- if (beg + len > clen)
+ if (len > clen - beg)
len = clen - beg;
if (len <= 0) {
len = 0;

Fix integer overflow; fix #3473

The fix is suggested by https://hackerone.com/lucnguyen