Permalink
Browse files

String#replace should check replacing string; fix #3374

This issue was reported by https://hackerone.com/tunz
  • Loading branch information...
matz committed Jan 11, 2017
1 parent 06b2e6a commit e1ff71029f95e3274136263adbdc51c662ec52de
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/string.c
View
@@ -519,6 +519,7 @@ str_replace(mrb_state *mrb, struct RString *s1, struct RString *s2)
long len;
check_frozen(mrb, s1);
if (s1 == s2) return mrb_obj_value(s1);
len = RSTR_LEN(s2);
if (RSTR_SHARED_P(s1)) {
str_decref(mrb, s1->as.heap.aux.shared);

0 comments on commit e1ff710

Please sign in to comment.