diff options
author | Tony Cook <tony@develop-help.com> | 2018-08-20 16:31:45 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2018-09-21 10:23:08 +1000 |
commit | 12cad9bd99725bba72029e2651b2b7f0cab2e0b0 (patch) | |
tree | 22ead3858e2707030696a8bb4abda102f8a9f55e /pp_pack.c | |
parent | 30a6480c0da19d85d20a159b9179b5b212c8c768 (diff) | |
download | perl-12cad9bd99725bba72029e2651b2b7f0cab2e0b0.tar.gz |
(perl #132655) nul terminate result of unpack "u" of invalid data
In the given test case, Perl_atof2() would run off the end of the PV,
producing an error from ASAN.
Diffstat (limited to 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1727,7 +1727,10 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c if (!checksum) { const STRLEN l = (STRLEN) (strend - s) * 3 / 4; sv = sv_2mortal(newSV(l)); - if (l) SvPOK_on(sv); + if (l) { + SvPOK_on(sv); + *SvEND(sv) = '\0'; + } } /* Note that all legal uuencoded strings are ASCII printables, so |