From 9835bbc7fbb3423163dc49e7d822dad2b135e192 Mon Sep 17 00:00:00 2001 From: ph10 Date: Tue, 15 Oct 2019 10:46:36 +0000 Subject: [PATCH] Ensure regexec is thread safe to avoid sanitizer warnings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1176 6239d852-aaf2-0410-a92c-79f79f948069 Petr Písař: Ported to 10.33. --- src/pcre2posix.c | 3 +-- diff --git a/src/pcre2posix.c b/src/pcre2posix.c index 34a8d80..b24620a 100644 --- a/src/pcre2posix.c +++ b/src/pcre2posix.c @@ -323,6 +323,7 @@ if (preg->re_pcre2_code == NULL) PCRE2_INFO_CAPTURECOUNT, &re_nsub); preg->re_nsub = (size_t)re_nsub; preg->re_match_data = pcre2_match_data_create(re_nsub + 1, NULL); +preg->re_erroffset = (size_t)(-1); /* No meaning after successful compile */ if (preg->re_match_data == NULL) { @@ -356,8 +357,6 @@ if ((eflags & REG_NOTBOL) != 0) options |= PCRE2_NOTBOL; if ((eflags & REG_NOTEOL) != 0) options |= PCRE2_NOTEOL; if ((eflags & REG_NOTEMPTY) != 0) options |= PCRE2_NOTEMPTY; -((regex_t *)preg)->re_erroffset = (size_t)(-1); /* Only has meaning after compile */ - /* When REG_NOSUB was specified, or if no vector has been passed in which to put captured strings, ensure that nmatch is zero. This will stop any attempt to write to pmatch. */ -- 2.21.0