Re: printf %s with NULL pointer (was Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped)

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: printf %s with NULL pointer (was Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped)
Date: 2021-07-22 06:20:28
Message-ID: 768db26c-cf9a-6943-38b1-2d5ac8cc86f2@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 14.07.21 18:26, Tom Lane wrote:
> Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> writes:
>> In this particular case, I would for example be quite curious how those
>> alternative minimal C libraries such as musl-libc handle this.
>
> Interesting question, so I took a look:
>
> https://git.musl-libc.org/cgit/musl/tree/src/stdio/vfprintf.c#n593
>
> case 's':
> a = arg.p ? arg.p : "(null)";
> ...
>
> Any others you'd like to consider?

Similar here:
https://github.com/ensc/dietlibc/blob/master/lib/__v_printf.c#L188

I think unless we get counterexamples, this is all good.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2021-07-22 07:25:43 Re: IRe: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows
Previous Message Thomas Munro 2021-07-22 03:30:32 Re: BUG #16696: Backend crash in llvmjit

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2021-07-22 06:31:34 Re: Hook for extensible parsing.
Previous Message vignesh C 2021-07-22 06:09:23 Re: Enhanced error message to include hint messages for redundant options error