sv_setsv is allowed to swipe buffers from read only scalars
Nicholas Clark [Wed, 8 Jun 2005 20:32:35 +0000 (20:32 +0000)]
p4raw-id: //depot/perl@24766

sv.c

diff --git a/sv.c b/sv.c
index b580af2..52f1da3 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -4564,7 +4564,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
             }
             else
                 {      /* Passes the swipe test.  */
-                SvPV_set(dstr, SvPVX(sstr));
+                SvPV_set(dstr, SvPVX_mutable(sstr));
                 SvLEN_set(dstr, SvLEN(sstr));
                 SvCUR_set(dstr, SvCUR(sstr));