Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,6 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
lsave = lc;
rsave = rc;

SvCUR_set(sv, len);
(void)SvPOK_only(sv);
if (SvOK(sv) || SvTYPE(sv) > SVt_PVMG) {
dc = SvPV_force_nomg_nolen(sv);
Expand All @@ -1106,6 +1105,7 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
sv_usepvn_flags(sv, dc, needlen, SV_HAS_TRAILING_NUL);
dc = SvPVX(sv); /* sv_usepvn() calls Renew() */
}
SvCUR_set(sv, len);

if (len >= sizeof(long)*4 &&
!(PTR2nat(dc) % sizeof(long)) &&
Expand Down
11 changes: 10 additions & 1 deletion t/op/bop.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ BEGIN {
# If you find tests are failing, please try adding names to tests to track
# down where the failure is, and supply your new names as a patch.
# (Just-in-time test naming)
plan tests => 501;
plan tests => 502;

# numerics
ok ((0xdead & 0xbeef) == 0x9ead);
Expand Down Expand Up @@ -669,3 +669,12 @@ foreach my $op_info ([and => "&"], [or => "|"], [xor => "^"]) {
like $@, $expected, $description;
}
}

{
# perl #17844 - only visible with valgrind/ASAN
fresh_perl_is(<<'EOS',
formline X000n^\\0,\\0^\\0for\0,0..10
EOS
'',
{}, "[perl #17844] access beyond end of block");
}