diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-02-28 10:02:13 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-02-28 10:02:13 +0900 |
| commit | 8b4660dfc7dc675a40945a66d80ba12aa47fb15a (patch) | |
| tree | a0d05364268d73af34f22c2279d4de5b8db7aed1 | |
| parent | f5ec2115b55a246c7532175d0db13d2394934e59 (diff) | |
| parent | dd5ccb6cd59ecae1889aae0f66516ca04291a454 (diff) | |
| download | mruby-8b4660dfc7dc675a40945a66d80ba12aa47fb15a.tar.gz mruby-8b4660dfc7dc675a40945a66d80ba12aa47fb15a.zip | |
Merge branch 'master' of github.com:mruby/mruby
| -rw-r--r-- | src/string.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/string.c b/src/string.c index 8a9ed8a24..aa1afec47 100644 --- a/src/string.c +++ b/src/string.c @@ -256,6 +256,9 @@ mrb_value mrb_str_new_static(mrb_state *mrb, const char *p, size_t len) { struct RString *s; + if ((mrb_int)len < 0) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "negative string size (or size too big)"); + } s = mrb_obj_alloc_string(mrb); s->len = len; |
