projects
/
p5sagit/p5-mst-13.2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
c6a7db4
)
Tweak to Encode.xs to avoid buffer overrun.
Nick Ing-Simmons [Sat, 20 Apr 2002 07:46:11 +0000 (07:46 +0000)]
p4raw-id: //depot/perlio@16014
ext/Encode/Encode.xs
patch
|
blob
|
blame
|
history
diff --git
a/ext/Encode/Encode.xs
b/ext/Encode/Encode.xs
index
1725db9
..
b42668b
100644
(file)
--- 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;