diff options
author | Hugo van der Sanden <hv@crypt.org> | 2015-02-18 14:59:53 +0000 |
---|---|---|
committer | Hugo van der Sanden <hv@crypt.org> | 2015-02-18 16:06:58 +0000 |
commit | fc1bb3f2dcaaac9f305b27acb4800babdc8a06f3 (patch) | |
tree | 816deaca5b07a9b4e59bc1b8066a321abb5e7ef0 /pp_pack.c | |
parent | d0bec20370cb0ec3e757fde65d8f1d13693e913f (diff) | |
download | perl-fc1bb3f2dcaaac9f305b27acb4800babdc8a06f3.tar.gz |
[perl #123874] fix argument underflow for pack()
NEXTFROM() modified the item count while testing it, so the next use
saw the count (of -1) as non-zero and ended up trying to write ~1 bytes.
Diffstat (limited to 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2094,7 +2094,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) char *cur = start + SvCUR(cat); bool needs_swap; -#define NEXTFROM (lengthcode ? lengthcode : items-- > 0 ? *beglist++ : &PL_sv_no) +#define NEXTFROM (lengthcode ? lengthcode : items > 0 ? (--items, *beglist++) : &PL_sv_no) #define PEEKFROM (lengthcode ? lengthcode : items > 0 ? *beglist : &PL_sv_no) switch (howlen) { |