diff --git a/mrbgems/mruby-sprintf/src/sprintf.c b/mrbgems/mruby-sprintf/src/sprintf.c index 7104a185a..25127334d 100644 --- a/mrbgems/mruby-sprintf/src/sprintf.c +++ b/mrbgems/mruby-sprintf/src/sprintf.c @@ -259,7 +259,7 @@ get_num(mrb_state *mrb, const char *p, const char *end, int *valp) { char *e; mrb_int n; - if (!mrb_read_int(p, end, &e, &n)) { + if (!mrb_read_int(p, end, &e, &n) || INT_MAX < n) { return NULL; } *valp = (int)n;