summaryrefslogtreecommitdiff
path: root/pp_pack.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-03-09 18:02:13 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-03-09 18:02:13 +0000
commitc0ffc3dc2599584812656dbd75ff30f089c769fe (patch)
tree64311fc981a1dd5bdfe7b787818490a5a149eae0 /pp_pack.c
parentf337b084e4f053c4222a0b9a773a9e12c0232e6d (diff)
downloadperl-c0ffc3dc2599584812656dbd75ff30f089c769fe.tar.gz
Fix memory corruption when growing pack utf8 buffer
p4raw-id: //depot/perl@24011
Diffstat (limited to 'pp_pack.c')
-rw-r--r--pp_pack.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pp_pack.c b/pp_pack.c
index c6e2d4ea04..6c9b92abe0 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -2917,17 +2917,17 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist )
fromstr = NEXTFROM;
auv = SvUV(fromstr);
if (utf8) {
- char buffer[UTF8_MAXLEN], *end;
- end = uvuni_to_utf8_flags(buffer, auv,
+ char buffer[UTF8_MAXLEN], *endb;
+ endb = uvuni_to_utf8_flags(buffer, auv,
ckWARN(WARN_UTF8) ?
0 : UNICODE_ALLOW_ANY);
- if (cur >= end-(end-buffer)*2) {
+ if (cur >= end-(endb-buffer)*2) {
*cur = '\0';
SvCUR(cat) = cur - start;
- GROWING(0, cat, start, cur, len+(end-buffer)*2);
+ GROWING(0, cat, start, cur, len+(endb-buffer)*2);
end = start+SvLEN(cat)-UTF8_MAXLEN;
}
- bytes_to_uni(aTHX_ buffer, end-buffer, &cur);
+ bytes_to_uni(aTHX_ buffer, endb-buffer, &cur);
} else {
if (cur >= end) {
*cur = '\0';