diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-07-04 17:14:59 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-07-04 17:14:59 +0900 |
| commit | ee32521f908ae8f27cb38bc98aa619426704c02b (patch) | |
| tree | 492c19b9ca58104553533f2da11439b2fc6917d6 | |
| parent | 472847adc24f10e30ef5ff09814cf12d6a3d372a (diff) | |
| download | mruby-ee32521f908ae8f27cb38bc98aa619426704c02b.tar.gz mruby-ee32521f908ae8f27cb38bc98aa619426704c02b.zip | |
add input check to readint_float()
| -rw-r--r-- | src/codegen.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |
