[Privoxy-devel] PATCH for pcre2 support
Fabian Keil
fk at fabiankeil.de
Mon Jun 19 11:30:31 CEST 2023
Fabian Keil <fk at fabiankeil.de> wrote on 2023-06-19 at 09:20:17:
> Gagan Sidhu <broly at mac.com> wrote on 2023-06-18 at 08:44:35:
>
> > test 17, i assume? since after i ran the program with your change, i had one failed test:
>
> No it's test 383:
>
> (gdb) where
> #0 kill () at kill.S:4
> #1 0x00000008008926e0 in __fail (msg=0x80079c824 "stack overflow detected; terminated") at /usr/src/lib/libc/secure/stack_protector.c:130
> #2 0x0000000800892650 in __stack_chk_fail () at /usr/src/lib/libc/secure/stack_protector.c:137
> #3 0x000000000024abed in rewrite_url (old_url=0x80246d000 "http://go.eniro.dk/lg/ni/http:/eas8.emediate.eu/eas?camp=79;ty=ct;EASLink=http://www.bt.dk?http://redirect.metropol.dk/cgi-bin/redir.pl?url=www.bt.dk",
> pcrs_command=0x801cac140 "s at .*url=@http://@") at filters.c:1038
> #4 0x000000000024acf7 in redirect_url (csp=0x800ef2c08) at filters.c:1257
> #5 0x00000000002583b5 in crunch_response_triggered (csp=0x800ef2c08, crunchers=0x218920 <crunchers_all>) at jcc.c:953
> #6 0x00000000002568bb in chat (csp=0x800ef2c08) at jcc.c:4438
> #7 0x0000000000255736 in serve (csp=0x800ef2c08) at jcc.c:5056
> #8 0x000000080073ca7a in thread_start (curthread=0x800e13c00) at /usr/src/lib/libthr/thread/thr_create.c:292
> #9 0x0000000000000000 in ?? ()
> Backtrace stopped: Cannot access memory at address 0x7fffdf9fb000
The attached patch seems to fix this. (It will not cleanly apply
to your tree as I made other changes in the region in previous
commits).
According to valgrind there are still invalid reads, though:
==38396== Invalid read of size 16
==38396== at 0x6E82389: ???
==38396== by 0x5ACB111: ???
==38396== Address 0x5acc048 is 6,056 bytes inside a block of size 6,069 alloc'd
==38396== at 0x484CBC4: malloc (in /usr/local/libexec/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==38396== by 0x276692: pcrs_execute (pcrs.c:974)
==38396== by 0x22E9E2: template_fill (cgi.c:2086)
==38396== by 0x22CBFA: template_fill_for_cgi (cgi.c:2168)
==38396== by 0x2456E9: cgi_show_url_info (cgisimple.c:1923)
==38396== by 0x22B4FE: dispatch_known_cgi (cgi.c:591)
==38396== by 0x22B2A0: dispatch_cgi (cgi.c:386)
==38396== by 0x258371: crunch_response_triggered (jcc.c:934)
==38396== by 0x25691A: chat (jcc.c:4438)
==38396== by 0x255795: serve (jcc.c:5056)
==38396== by 0x4CD5A79: ??? (in /lib/libthr.so.3)
==38396== by 0x1FDB7FCFFF: ???
Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pcrs_compile-Pass-a-proper-PCRE_SIZE-variable-to-pcr.patch
Type: text/x-patch
Size: 2134 bytes
Desc: not available
URL: <https://lists.privoxy.org/pipermail/privoxy-devel/attachments/20230619/6af271eb/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.privoxy.org/pipermail/privoxy-devel/attachments/20230619/6af271eb/attachment-0001.bin>
More information about the Privoxy-devel
mailing list