Re: Don't pass NULL pointer to strcmp().

From: Junwang Zhao <zhjwpku(at)gmail(dot)com>
To: Xing Guo <higuoxing(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Don't pass NULL pointer to strcmp().
Date: 2023-11-01 10:21:00
Message-ID: CAEG8a3KtVY=ahY4zVX6AfqMV32Ri1HBhSMGZ1p-W_w5bUGMQ+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 1, 2023 at 5:25 PM Xing Guo <higuoxing(at)gmail(dot)com> wrote:
>
> Hi hackers,
>
> I found that there's a nullable pointer being passed to strcmp() and
> can make the server crash. It can be reproduced on the latest master
> branch by crafting an extension[1]. Patch for fixing it is attatched.
>
> [1] https://github.com/higuoxing/guc_crash/tree/pg
>

Can we set a string guc to NULL? If not, `*lconf->variable == NULL` would
be unnecessary.

> --
> Best Regards,
> Xing

--
Regards
Junwang Zhao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2023-11-01 10:32:46 Re: btree: implement dynamic prefix truncation (was: Improving btree performance through specializing by key shape, take 2)
Previous Message Andrew Dunstan 2023-11-01 10:19:31 Re: More new SQL/JSON item methods