]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
util_pcre: Restore nmatch < ncaps behaviour with PCRE1 (only).
authorYann Ylavic <ylavic@apache.org>
Fri, 15 Jul 2022 10:46:37 +0000 (10:46 +0000)
committerYann Ylavic <ylavic@apache.org>
Fri, 15 Jul 2022 10:46:37 +0000 (10:46 +0000)
commit97afea48fd328304d74fc174c742518175063ab7
treeba36314205a3d0e13d12f153dc5786a267c6f15c
parentf589ecaa68cfe3be8694042035efc8343715e25c
util_pcre: Restore nmatch < ncaps behaviour with PCRE1 (only).

When the requested nmatch is below the number of captures for the regex (i.e.
nmatch is zero if the user does not care about the captures), with PCRE1 we can
pass a smaller ovector to pcre_exec() (or even NULL) which allows for somes
optimizations (less or even no recursion) internally in pcre.

This might avoid crashes due to stack usage/exhaustion with pathological
patterns (see BZ 66119).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1902732 13f79535-47bb-0310-9956-ffa450edef68
server/util_pcre.c