diff options
author | Hugo van der Sanden <hv@crypt.org> | 2020-03-27 14:35:24 +0000 |
---|---|---|
committer | Hugo van der Sanden <hv@crypt.org> | 2020-03-27 14:52:25 +0000 |
commit | 51c9ef5418883d5ebb272093a628d955fe1cc323 (patch) | |
tree | 4c9f045e86ff47bd9c92aaae6eb71ba30d5b11a7 /toke.c | |
parent | e0ab3efe60276d859717e50212fa157323e89a54 (diff) | |
download | perl-51c9ef5418883d5ebb272093a628d955fe1cc323.tar.gz |
gh-17645: avoid oob read on conflict marker detection
Introduced in 0ae5281a2d.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -8835,7 +8835,7 @@ yyl_try(pTHX_ char *s, STRLEN len) case '=': if (s[1] == '=' && (s == PL_linestart || s[-1] == '\n') - && memBEGINs(s + 2, (STRLEN) (PL_bufend - s + 2), "=====")) + && memBEGINs(s + 2, (STRLEN) (PL_bufend - (s + 2)), "=====")) { s = vcs_conflict_marker(s + 7); goto retry; @@ -8929,7 +8929,7 @@ yyl_try(pTHX_ char *s, STRLEN len) case '<': if (s[1] == '<' && (s == PL_linestart || s[-1] == '\n') - && memBEGINs(s+2, (STRLEN) (PL_bufend - (s+2)), "<<<<<")) + && memBEGINs(s + 2, (STRLEN) (PL_bufend - (s + 2)), "<<<<<")) { s = vcs_conflict_marker(s + 7); goto retry; @@ -8938,7 +8938,7 @@ yyl_try(pTHX_ char *s, STRLEN len) case '>': if (s[1] == '>' && (s == PL_linestart || s[-1] == '\n') - && memBEGINs(s + 2, (STRLEN) (PL_bufend - s + 2), ">>>>>")) + && memBEGINs(s + 2, (STRLEN) (PL_bufend - (s + 2)), ">>>>>")) { s = vcs_conflict_marker(s + 7); goto retry; |