This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv_setsv is allowed to swipe buffers from read only scalars
authorNicholas Clark <nick@ccl4.org>
Wed, 8 Jun 2005 20:32:35 +0000 (20:32 +0000)
committerNicholas Clark <nick@ccl4.org>
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));