Fix integer overflow; fix
The fix is suggested by
@@ -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;
