Re: Simplifies checks (src/bin/pg_dump/pg_backup_archiver.c) - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Simplifies checks (src/bin/pg_dump/pg_backup_archiver.c)
Date
Msg-id 00DD62ED-F445-4344-989D-BE8C26C05E94@yesql.se
Whole thread Raw
In response to Simplifies checks (src/bin/pg_dump/pg_backup_archiver.c)  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-hackers
> On 9 Mar 2026, at 14:07, Ranier Vilela <ranier.vf@gmail.com> wrote:

> Coverity has some alerts about the function *RestoreArchive*,
> arguing that there are null variable dereferences.

Coverity is very good at generating false positives.

> I haven't done in-depth research to determine if this is correct or not.
> However, the code can be simplified to a single check that would silence notifications and protect against this
issue.

You probably should do that research.  What if te is actually null and with
your patch the code accepts it rather than crashes.  Does that affect the
integrity of the dump?  Will it crash soon after? Is te allowed to be null?

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Avoid multiple calls to memcpy (src/backend/access/index/genam.c)
Next
From: Alena Rybakina
Date:
Subject: Re: Vacuum statistics