mruby-sprintf/sprintf.c: check integer overflow before casting.
MODIFY
mrbgems/mruby-sprintf/src/sprintf.c
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;

mruby-sprintf/sprintf.c: check integer overflow before casting.