/[packages]/cauldron/privoxy/current/SOURCES/privoxy-pcre2-patternfix.patch
ViewVC logotype

Contents of /cauldron/privoxy/current/SOURCES/privoxy-pcre2-patternfix.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2002236 - (show annotations) (download)
Sat Oct 28 05:32:00 2023 UTC (7 months, 2 weeks ago) by daviddavid
File size: 1775 byte(s)
- add debian patches to switch to pcre2

1 From: Fabian Keil <fk@fabiankeil.de>
2 Date: Sun, 27 Aug 2023 12:26:02 +0200
3 Origin: upstream, https://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff;h=87253c99, https://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff;h=e73b93ea
4 Forwarded: not-needed
5 Bug: https://sourceforge.net/p/ijbswa/bugs/935/#4755
6 Subject: pcre2 compile_pattern(): Pass the anchored pattern to pcre2_compile()
7 Previously the un-anchoring pattern was compiled resulting in incorrect
8 matches.
9
10 For example requests to:
11
12 https://www.privoxy.org/user-manual/config.html
13
14 were redirected because of the default.action section:
15
16 {+redirect{http://config.privoxy.org/}}
17 # Sticky Actions = +redirect{http://config.privoxy.org/}
18 # URL = http://www.privoxy.org/config
19 # Redirected URL = http://www.privoxy.org/config
20 # Redirect Destination = http://config.privoxy.org/
21 .privoxy.org/config
22
23 As the path pattern is left-anchored it should not match.
24
25 Additionally add a regression test for this.
26
27 --- a/urlmatch.c
28 +++ b/urlmatch.c
29 @@ -666,7 +666,7 @@ static jb_err compile_pattern(const char
30
31 snprintf(rebuf, rebuf_size, fmt, pattern);
32
33 - *regex = pcre2_compile((const unsigned char *)pattern,
34 + *regex = pcre2_compile((const unsigned char *)rebuf,
35 PCRE2_ZERO_TERMINATED, PCRE2_CASELESS, &errcode,
36 &error_offset, NULL);
37 if (*regex == NULL)
38 --- a/regression-tests.action
39 +++ b/regression-tests.action
40 @@ -1152,3 +1152,8 @@ PCRE-HOST-PATTERN:^a{3}\.example\.org$
41 # Blocked URL = http://bbb.example.org/
42 # Level = 26
43 PCRE-HOST-PATTERN:^(bbb|ccc|ddd)\.example\.org$
44 +
45 +{+block{Block should not apply because the path pattern is left-anchored}}
46 +# Sticky Actions = -block
47 +# URL = http://www.example.org/tralala/blafasel
48 +www.example.org/blafasel

  ViewVC Help
Powered by ViewVC 1.1.30