pcre2 compile_pattern(): Actually pass the anchored pattern to pcre2_compile()
authorFabian Keil <fk@fabiankeil.de>
Sun, 27 Aug 2023 10:26:02 +0000 (12:26 +0200)
committerFabian Keil <fk@fabiankeil.de>
Sun, 27 Aug 2023 10:55:06 +0000 (12:55 +0200)
commite73b93ea9ad1f3e980bd78ed3ebf65dedbb598a2
tree2608b9cbb682f3ba9ab4ef41519950c2979bb18b
parent7fb978c74a8a46bd105d9f0ced92a4be0c9647e6
pcre2 compile_pattern(): Actually pass the anchored pattern to pcre2_compile()

Previously the un-anchoring pattern was compiled resulting
in incorrect matches.

For example requests to:

    https://www.privoxy.org/user-manual/config.html

were redirected because of the default.action section:

    {+redirect{http://config.privoxy.org/}}
    # Sticky Actions = +redirect{http://config.privoxy.org/}
    # URL = http://www.privoxy.org/config
    # Redirected URL = http://www.privoxy.org/config
    # Redirect Destination = http://config.privoxy.org/
    .privoxy.org/config

As the path pattern is left-anchored it should not match.
urlmatch.c