Re: [BUGFIX] Fix crash due to sizeof bug in RegisterExtensionExplainOption

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Andreas Karlsson <andreas@proxel.se>
Cc: Joel Jacobson <joel@compiler.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-03-03T04:13:11Z
Lists: pgsql-hackers
On Tue, Mar 03, 2026 at 04:39:43AM +0100, Andreas Karlsson wrote:
> Shouldn't the patch have used repalloc_array()? If the code had done so in
> the first place the bug would never have happened.

I was considering that first.  However, after looked at the
MemoryContextAlloc() and the inconsistency that repalloc_array() was
bringing, I have turned the thought away.
--
Michael

Commits

  1. Fix memory allocation size in RegisterExtensionExplainOption()