Re: Support LIKE with nondeterministic collations

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Daniel Verite <daniel(at)manitou-mail(dot)org>, Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
Subject: Re: Support LIKE with nondeterministic collations
Date: 2024-11-04 08:26:37
Message-ID: 0ca761b5-7b62-42a1-bffd-8bedefad48dd@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 29.10.24 18:15, Jacob Champion wrote:
> libfuzzer is unhappy about the following code in MatchText:
>
>> + while (p1len > 0)
>> + {
>> + if (*p1 == '\\')
>> + {
>> + found_escape = true;
>> + NextByte(p1, p1len);
>> + }
>> + else if (*p1 == '_' || *p1 == '%')
>> + break;
>> + NextByte(p1, p1len);
>> + }
>
> If the pattern ends with a backslash, we'll call NextByte() twice,
> p1len will wrap around to INT_MAX, and we'll walk off the end of the
> buffer. (I fixed it locally by duplicating the ERROR case that's
> directly above this.)

Thanks. Here is an updated patch with that fixed.

Attachment Content-Type Size
v6-0001-Support-LIKE-with-nondeterministic-collations.patch text/plain 25.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2024-11-04 08:27:43 Re: Clear padding in PgStat_HashKey keys
Previous Message Michael Paquier 2024-11-04 07:25:00 Re: Clear padding in PgStat_HashKey keys