From ee32521f908ae8f27cb38bc98aa619426704c02b Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Wed, 4 Jul 2012 17:14:59 +0900 Subject: add input check to readint_float() --- src/codegen.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/codegen.c b/src/codegen.c index 8aef2a328..963e94b21 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -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; -- cgit v1.2.3