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

Поиск
Список
Период
Сортировка
От Xing Guo
Тема Re: Don't pass NULL pointer to strcmp().
Дата
Msg-id CACpMh+D7yZs4t17usc+rmvA1PjwbNqX7+4C+pDoSO++PSCfing@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Don't pass NULL pointer to strcmp().  (Aleksander Alekseev <aleksander@timescale.com>)
Ответы Re: Don't pass NULL pointer to strcmp().  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi Aleksander and Junwang,

Thanks for your comments. I have updated the patch accordingly.

Best Regards,
Xing








On Wed, Nov 1, 2023 at 7:44 PM Aleksander Alekseev <aleksander@timescale.com> wrote:
Hi,

> > 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

Thanks for reporting. I can confirm that the issue reproduces on the
`master` branch and the proposed patch fixes it.

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

Judging by the rest of the code we better keep it, at least for consistenc.

I see one more place with a similar code in guc.c around line 1472.
Although I don't have exact steps to trigger a crash I suggest adding
a similar check there.

--
Best regards,
Aleksander Alekseev
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jakub Wartak
Дата:
Сообщение: Re: trying again to get incremental backup
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: speed up a logical replica setup