From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: dcb314@hotmail.com
Subject: BUG #19065: postgresql-18.0/src/bin/pg_combinebackup/reconstruct.c:230: Array sanity check in wrong place ?
Date: Fri, 26 Sep 2025 09:48:20 +0000
Message-ID: <19065-daff7954081eddc0@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 19065
Logged by: David Binderman
Email address: dcb314@hotmail.com
PostgreSQL version: 18.0
Operating system: fedora 42
Description:
Static analyser cppcheck said:
postgresql-18.0/src/bin/pg_combinebackup/reconstruct.c:230:18: style: Array
index 'b' is used before limits check. [arrayIndexThenCheck]
Source code is
if (sourcemap[b] == NULL && b < blocklength)
Suggest new code
if (b < blocklength && sourcemap[b] == NULL)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, dcb314@hotmail.com
Subject: Re: BUG #19065: postgresql-18.0/src/bin/pg_combinebackup/reconstruct.c:230: Array sanity check in wrong place ?
In-Reply-To: <19065-daff7954081eddc0@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox