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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGFIX] Fix crash due to sizeof bug in RegisterExtensionExplainOption
Date: 2026-03-02 03:18:17
Message-ID: aaUBeYzQTw5AETZh@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Mar 01, 2026 at 06:10:10PM +0100, Joel Jacobson wrote:
> The allocations in src/backend/commands/explain_state.c
> used sizeof(char *) instead of sizeof(ExplainExtensionOption),
> which could cause a crash if an extension would register
> more than 8 extension EXPLAIN options:

Indeed, that's wrong as-is. The problem can be reproduced simply by
saving more options into pg_overexplain, as well, leading to the same
memory chunk issues. Will fix, thanks for the report.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jinbinge 2026-03-02 03:38:30 Re: pg_resetwal.c: duplicate '0' in hex character set for -l option validation
Previous Message zhanghu 2026-03-02 03:17:56 Re: guc: make dereference style consistent in check_backtrace_functions