diff options
author | Yves Orton <demerphq@gmail.com> | 2016-04-08 20:46:43 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2016-04-08 21:30:50 +0200 |
commit | e19cb11142087974d956f263d24e146b968025d5 (patch) | |
tree | e69f738c8739116ba391657c3d192afc5a426fc2 /sv.c | |
parent | d14d5855c45a17996ec1e16e2f3cfa8ecef24809 (diff) | |
download | perl-e19cb11142087974d956f263d24e146b968025d5.tar.gz |
fix #127855, in Perl_sv_setpvn() we have to overallocate to enable COW
We need to overallocate by 2 to do COW strings. One for the null,
one for the refcount.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4891,7 +4891,7 @@ Perl_sv_setpvn(pTHX_ SV *const sv, const char *const ptr, const STRLEN len) } SvUPGRADE(sv, SVt_PV); - dptr = SvGROW(sv, len + 1); + dptr = SvGROW(sv, len + 2); Move(ptr,dptr,len,char); dptr[len] = '\0'; SvCUR_set(sv, len); |