From 0de65a88d44c108ec5035be2741bed486ad88de5 Mon Sep 17 00:00:00 2001 From: ksss Date: Fri, 23 Dec 2016 23:13:23 +0900 Subject: Do nothing when empty string Fix #3361 --- src/string.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index ce27cdaa1..a177aafba 100644 --- a/src/string.c +++ b/src/string.c @@ -754,6 +754,9 @@ mrb_str_concat(mrb_state *mrb, mrb_value self, mrb_value other) other = mrb_str_to_str(mrb, other); } s2 = mrb_str_ptr(other); + if (RSTR_LEN(s2) == 0) { + return; + } len = RSTR_LEN(s1) + RSTR_LEN(s2); if (RSTRING_CAPA(self) < len) { -- cgit v1.2.3