]> git.ipfire.org Git - thirdparty/git.git/commit - grep.h
grep: work around UTF-8 related JIT bug in PCRE2 <= 10.34
authorMathias Krause <minipli@grsecurity.net>
Thu, 23 Mar 2023 17:25:39 +0000 (18:25 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Mar 2023 18:19:34 +0000 (11:19 -0700)
commit14b9a044798ebb3858a1f1a1377309a3d6054ac8
treeb6a98d7b1ceaacf691d951836fd9254963c518da
parentacabd2048ee0ee53728100408970ab45a6dab65e
grep: work around UTF-8 related JIT bug in PCRE2 <= 10.34

Stephane is reporting[1] a regression introduced in git v2.40.0 that leads
to 'git grep' segfaulting in his CI pipeline. It turns out, he's using an
older version of libpcre2 that triggers a wild pointer dereference in
the generated JIT code that was fixed in PCRE2 10.35.

Instead of completely disabling the JIT compiler for the buggy version,
just mask out the Unicode property handling as we used to do prior to
commit acabd2048ee0 ("grep: correctly identify utf-8 characters with
\{b,w} in -P").

[1] https://lore.kernel.org/git/7E83DAA1-F9A9-4151-8D07-D80EA6D59EEA@clumio.com/

Reported-by: Stephane Odul <stephane@clumio.com>
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
grep.c
grep.h