summaryrefslogtreecommitdiff
path: root/pp_pack.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2015-10-22 12:03:05 +1100
committerTony Cook <tony@develop-help.com>2015-11-11 13:30:39 +1100
commit0403a1ad8ff01aaac2d09a986ea6bb5210472459 (patch)
tree349419ce72afc0861518db58c3bfc280e940ed6b /pp_pack.c
parentfdfd5e4d926a555f6d4f156d79198d8c6db9dc44 (diff)
downloadperl-0403a1ad8ff01aaac2d09a986ea6bb5210472459.tar.gz
[perl #126325] don't read past the end of the source for pack [Hh]
With a utf8 target but a non-utf8 source, pack Hh would read past the end of the source when given a length, due to an incorrect condition.
Diffstat (limited to 'pp_pack.c')
-rw-r--r--pp_pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_pack.c b/pp_pack.c
index 96dfd20157..044ea7f2ce 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -2488,7 +2488,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist )
if (howlen == e_star) len = fromlen;
field_len = (len+1)/2;
GROWING(utf8, cat, start, cur, field_len);
- if (!utf8 && len > (I32)fromlen) len = fromlen;
+ if (!utf8_source && len > (I32)fromlen) len = fromlen;
bits = 0;
l = 0;
if (datumtype == 'H')