Re: Ineffective Assert-check in CopyMultiInsertInfoNextFreeSlot()

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Amul Sul <sulamul(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ineffective Assert-check in CopyMultiInsertInfoNextFreeSlot()
Date: 2024-08-16 22:38:37
Message-ID: CAApHDvo8yke11VJoePkOdrZjW4fcD4zwbuocNddFj=nxMcmq3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 16 Aug 2024 at 23:48, Amul Sul <sulamul(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2024-08-16 23:36:36 Re: Opinion poll: Sending an automated email to a thread when it gets added to the commitfest
Previous Message Tom Lane 2024-08-16 22:20:38 Re: macOS prefetching support