mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
add input check to readint_float()
This commit is contained in:
@@ -802,6 +802,7 @@ readint_float(codegen_scope *s, const char *p, int base)
|
||||
mrb_float f = 0;
|
||||
int n;
|
||||
|
||||
if (*p == '+') p++;
|
||||
while (p < e) {
|
||||
char c = *p;
|
||||
c = tolower((unsigned char)c);
|
||||
@@ -812,6 +813,9 @@ readint_float(codegen_scope *s, const char *p, int base)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (n == base) {
|
||||
codegen_error(s, "malformed readint input");
|
||||
}
|
||||
p++;
|
||||
}
|
||||
return f;
|
||||
|
||||
Reference in New Issue
Block a user