summaryrefslogtreecommitdiff
path: root/ext/Encode/Encode.xs
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2002-04-20 07:46:11 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2002-04-20 07:46:11 +0000
commit0172fc7f023949162f3e79310fb0db0dd22a98f1 (patch)
treeb625ef9d353697fddde79f9b2736dd9d27250637 /ext/Encode/Encode.xs
parentc6a7db43c3667911196e8ad7c6a3ad53333f3cf3 (diff)
downloadperl-0172fc7f023949162f3e79310fb0db0dd22a98f1.tar.gz
Tweak to Encode.xs to avoid buffer overrun.
p4raw-id: //depot/perlio@16014
Diffstat (limited to 'ext/Encode/Encode.xs')
-rw-r--r--ext/Encode/Encode.xs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/Encode/Encode.xs b/ext/Encode/Encode.xs
index 1725db98ca..b42668b81b 100644
--- a/ext/Encode/Encode.xs
+++ b/ext/Encode/Encode.xs
@@ -179,8 +179,8 @@ encode_method(pTHX_ encode_t * enc, encpage_t * dir, SV * src,
}
}
/* settle variables when fallback */
- dlen = SvCUR(dst);
- d = (U8*)SvPVX(dst) + dlen;
+ d = (U8*)SvEND(dst);
+ dlen = SvLEN(dst)-ddone-1;
s = (U8*)SvPVX(src) + sdone;
slen = tlen - sdone;
break;