diff options
author | Hugo van der Sanden <hv@crypt.org> | 2019-03-25 11:27:12 +0000 |
---|---|---|
committer | Hugo van der Sanden <hv@crypt.org> | 2019-03-27 13:11:55 +0000 |
commit | fd8def15a58c97aa89cce8569befded97fd8c3b7 (patch) | |
tree | 58ab8adfe374976ec82d695cabd2ec16489d43f6 /regexec.c | |
parent | 5e6a22d7364217775613ba7a991efcc1c7152e9f (diff) | |
download | perl-fd8def15a58c97aa89cce8569befded97fd8c3b7.tar.gz |
[perl #133892] coredump in Perl_re_intuit_start
Make sure we have a valid non-utf8 'other' check substring before we
try to use it.
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1173,8 +1173,8 @@ Perl_re_intuit_start(pTHX_ /* now look for the 'other' substring if defined */ - if (utf8_target ? prog->substrs->data[other_ix].utf8_substr - : prog->substrs->data[other_ix].substr) + if (prog->substrs->data[other_ix].utf8_substr + || prog->substrs->data[other_ix].substr) { /* Take into account the "other" substring. */ char *last, *last1; @@ -1184,6 +1184,11 @@ Perl_re_intuit_start(pTHX_ do_other_substr: other = &prog->substrs->data[other_ix]; + if (!utf8_target && !other->substr) { + if (!to_byte_substr(prog)) { + NON_UTF8_TARGET_BUT_UTF8_REQUIRED(fail); + } + } /* if "other" is anchored: * we've previously found a floating substr starting at check_at. |