Re: Ineffective Assert-check in CopyMultiInsertInfoNextFreeSlot() - Mailing list pgsql-hackers

From David Rowley
Subject Re: Ineffective Assert-check in CopyMultiInsertInfoNextFreeSlot()
Date
Msg-id CAApHDvo8yke11VJoePkOdrZjW4fcD4zwbuocNddFj=nxMcmq3w@mail.gmail.com
Whole thread Raw
List pgsql-hackers
On Fri, 16 Aug 2024 at 23:48, Amul Sul <sulamul@gmail.com> wrote:
> The Assert(buffer != NULL) is placed after the buffer is accessed,
> which could lead to a segmentation fault before the check is executed.

Yeah, that's not great. Technically the Assert does not add any value
in terms of catching bugs in the code, but it's probably useful to
keep it for code documentation purposes. A crash would occur even if
the Assert wasn't there.

> Attached a small patch to correct that.

Pushed.

David



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: macOS prefetching support
Next
From: David Rowley
Date:
Subject: Re: Opinion poll: Sending an automated email to a thread when it gets added to the commitfest