Re: [PATCH] grep: avoid setting UTF mode when not needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 16, 2021 at 4:50 AM Ævar Arnfjörð Bjarmason
<avarab@xxxxxxxxx> wrote:
> First, if we've got a post-PCREv2 version whatever fix let's guard that
> with an ifdef, see thep GIT_PCRE2_VERSION_*_HIGHER at the top of grep.h.

The availability of PCRE2_MATCH_INVALID_UTF does that implicitly, but
adding one makes sense to make it explicit; specially if it leads to
better testing.

> In the context of this being a pretty urgent post-release fix (but I
> don't know if Junio would consider a point-release, so perhaphs it's
> not) I'd be OK with either of:
>
>  A. Let's back out this new log grep color thing entirely while we
>     reconsider this. The gitster/hm/paint-hits-in-log-grep topic
>     currently reverts cleanly.

Agree that reverting the whole feature makes more sense, but was
aiming to the minimum change required to allow for a "brown bag"
release with this.

The way the PCRE2 integration works, uses the fast path that presumes
valid UTF-8 and is documented[1] to have "Undefined Behaviour" when
the subject that is being searched on is not.

That has been shown before to lead to crashes or infinite loops

Carlo

[1] https://www.pcre.org/current/doc/html/pcre2jit.html#SEC4




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux