Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace

From: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Grigorev Jurij <ju(dot)grigorev(at)ftdata(dot)ru>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace
Date: 2026-09-16 22:16:23
Message-ID: CAOYmi+=+U2G+Nn0-f0DYS+Sm80c3Ez7wHZx4t8L=RwaT9P-AVQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Sep 15, 2026 at 2:43 PM Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
> pstrdup calls strlen which segfault on NULL. oauth_validator_libraries_string
> has a default value of "" so it cannot be set to NULL by user action, but the
> global variable backing the GUC is initialized as NULL so I wonder if it's
> worth adding defensive programming like the below, or perhaps an Assert?

It looks like there are no GUC_LIST_INPUT params with a NULL
.boot_val. I don't know if that's by design, but it's probably for the
best given the decision in ff4597acd4c.

There may be a bit of a tug-of-war going on between committers who
prefer the explicit Assert() crash vs committers who are fine with the
SEGV. (I prefer the assertion when it better documents intent, but at
time of authorship I'm not sure I would have wanted to argue about it.
:D)

Thanks,
--Jacob

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2026-09-16 22:26:34 Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace
Previous Message Jeff Davis 2026-09-16 20:07:35 TID Range Scans can return wrong results after scanning backwards