Re: BUG #19920: Out-of-Bounds Read on a Zero-Length Array in pg_trgm word_similarity('', '')

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: nakamurajames123(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #19920: Out-of-Bounds Read on a Zero-Length Array in pg_trgm word_similarity('', '')
Date: 2026-11-19 12:26:56
Message-ID: EF53A8EA-7A1C-4720-B538-0909CE5A677E@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On 19 Nov 2026, at 13:10, Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:

> I have also found this some time ago with UBSAN, but didn't report due to no actual server crash. Anyway LGTM

Thanks for confirming. We could of course try and exit early on zero length
but it hardly seems worth the trouble to optimize a nonsensical case, thus the
trivial patch.

--
Daniel Gustafsson

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Fujii Masao 2026-11-19 12:31:24 Re: BUG #19918: SIGSEGV in auto_explain + EXPLAIN (BUFFERS)
Previous Message Joao Rito 2026-11-19 12:26:49 Re: BUG #19689: MERGE INSERT accepts a set-returning function during PREPARE but fails at EXECUTE