diff options
author | Yann Ylavic <ylavic@apache.org> | 2022-01-20 14:15:36 +0100 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2022-01-20 14:15:36 +0100 |
commit | f01e29d89d5ef65949e2f16b40e57488e83f8819 (patch) | |
tree | 29b6a66e49e3059766d19e42f8a12fad925120bd /server | |
parent | ap_regex: Follow up to r1897244: Fix pmatch overflow and returned value at li... (diff) | |
download | apache2-f01e29d89d5ef65949e2f16b40e57488e83f8819.tar.xz apache2-f01e29d89d5ef65949e2f16b40e57488e83f8819.zip |
ap_regex: Follow up to r1897240: Fix issues spotted by RĂ¼diger (thanks!).
#include "apr_thread_proc.h" is enough/needed by util_pcre.c and main.c.
Fix compilation (vector => ovector) for !HAVE_PCRE2 && APR_HAS_THREAD_LOCAL.
Check pcre2_match_data_create() return value for HAVE_PCRE2 && !APR_HAS_THREAD_LOCAL.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897250 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/main.c | 1 | ||||
-rw-r--r-- | server/util_pcre.c | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/server/main.c b/server/main.c index 8a1d5273d9..9f9965598d 100644 --- a/server/main.c +++ b/server/main.c @@ -21,6 +21,7 @@ #include "apr_lib.h" #include "apr_md5.h" #include "apr_time.h" +#include "apr_thread_proc.h" #include "apr_version.h" #include "apu_version.h" diff --git a/server/util_pcre.c b/server/util_pcre.c index 0233d161d6..2a3deefead 100644 --- a/server/util_pcre.c +++ b/server/util_pcre.c @@ -53,10 +53,9 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "httpd.h" -#include "apr_version.h" -#include "apr_portable.h" #include "apr_strings.h" #include "apr_tables.h" +#include "apr_thread_proc.h" #ifdef HAVE_PCRE2 #define PCRE2_CODE_UNIT_WIDTH 8 @@ -331,7 +330,7 @@ static match_data_pt get_match_data(apr_size_t size, #ifdef HAVE_PCRE2 *ovector = pcre2_get_ovector_pointer(tls->data); #else - *vector = tls->data; + *ovector = tls->data; #endif return tls->data; } @@ -353,7 +352,9 @@ static match_data_pt get_match_data(apr_size_t size, #ifdef HAVE_PCRE2 data = pcre2_match_data_create(size, NULL); - *ovector = pcre2_get_ovector_pointer(data); + if (data) { + *ovector = pcre2_get_ovector_pointer(data); + } #else if (size > POSIX_MALLOC_THRESHOLD) { data = malloc(size * sizeof(int) * 3); |