projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
238ae71
)
Purify finding: jperl.t causes a few Array Bounds Reads
author
Jarkko Hietaniemi
<jhi@iki.fi>
Wed, 15 May 2002 12:44:06 +0000
(12:44 +0000)
committer
Jarkko Hietaniemi
<jhi@iki.fi>
Wed, 15 May 2002 12:44:06 +0000
(12:44 +0000)
(one byte too far in a malloced buffer) at various spots
in regcomp.c, all the buffers malloced by SvGROW() in
sv_recode_to_utf8().
p4raw-id: //depot/perl@16608
sv.c
patch
|
blob
|
history
diff --git
a/sv.c
b/sv.c
index 13b548bd5e16644fcba0fa18f5700d9396f6fb91..5992a69b2f400e88c37e8f829e5099fe64d595b6 100644
(file)
--- a/
sv.c
+++ b/
sv.c
@@
-10474,9
+10474,10
@@
Perl_sv_recode_to_utf8(pTHX_ SV *sv, SV *encoding)
PUTBACK;
s = SvPV(uni, len);
if (s != SvPVX(sv)) {
- SvGROW(sv, len);
+ SvGROW(sv, len
+ 1
);
Move(s, SvPVX(sv), len, char);
SvCUR_set(sv, len);
+ SvPVX(sv)[len] = 0;
}
FREETMPS;
LEAVE;