This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d14d585
)
fix #127855, in Perl_sv_setpvn() we have to overallocate to enable COW
author
Yves Orton
<demerphq@gmail.com>
Fri, 8 Apr 2016 18:46:43 +0000
(20:46 +0200)
committer
Yves Orton
<demerphq@gmail.com>
Fri, 8 Apr 2016 19:30:50 +0000
(21:30 +0200)
We need to overallocate by 2 to do COW strings. One for the null,
one for the refcount.
sv.c
patch
|
blob
|
blame
|
history
diff --git
a/sv.c
b/sv.c
index
0200679
..
68df702
100644
(file)
--- a/
sv.c
+++ b/
sv.c
@@
-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);