diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-06-08 16:59:57 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-06-08 16:59:57 +0900 |
| commit | a5f323835e764b4f6d01ff34b0b245561f278f26 (patch) | |
| tree | ed959f35d1bc6bfdede049554339cde5c27320c9 /src/string.c | |
| parent | 972cc8b5a8c0378c391f981153ccdccf24c89d21 (diff) | |
| download | mruby-a5f323835e764b4f6d01ff34b0b245561f278f26.tar.gz mruby-a5f323835e764b4f6d01ff34b0b245561f278f26.zip | |
string.c: add `base>36` check to `String#to_i`.
Diffstat (limited to 'src/string.c')
| -rw-r--r-- | src/string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c index 2258dce2c..679e6585a 100644 --- a/src/string.c +++ b/src/string.c @@ -2439,7 +2439,7 @@ mrb_str_to_i(mrb_state *mrb, mrb_value self) mrb_int base = 10; mrb_get_args(mrb, "|i", &base); - if (base < 0) { + if (base < 0 || 36 < base) { mrb_raisef(mrb, E_ARGUMENT_ERROR, "illegal radix %i", base); } return mrb_str_to_inum(mrb, self, base, FALSE); |
