Commit ee32521f authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

add input check to readint_float()

parent 472847ad
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment