mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mrb_str_len_to_inum: converting may not be terminated by NUL; fix #3044
This commit is contained in:
+2
-1
@@ -2163,7 +2163,8 @@ mrb_str_len_to_inum(mrb_state *mrb, const char *str, size_t len, int base, int b
|
||||
n *= base;
|
||||
n += c;
|
||||
if (n > MRB_INT_MAX) {
|
||||
mrb_raisef(mrb, E_ARGUMENT_ERROR, "string (%S) too big for integer", mrb_str_new_cstr(mrb, str));
|
||||
mrb_raisef(mrb, E_ARGUMENT_ERROR, "string (%S) too big for integer",
|
||||
mrb_str_new(mrb, str, pend-str));
|
||||
}
|
||||
}
|
||||
val = n;
|
||||
|
||||
Reference in New Issue
Block a user