public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ranier Vilela <[email protected]>
To: Pg Hackers <[email protected]>
Subject: Fix array access (src/bin/pg_dump/pg_dump.c)
Date: Tue, 12 Nov 2024 14:05:40 -0300
Message-ID: <CAEudQAo7ah=4TDheuEjtb0dsv6bHoK7uBNqv53Tsub2h-xBSJw@mail.gmail.com> (raw)

Hi.

Per Coverity.

The function *determineNotNullFlags* has a little oversight.
The struct field *notnull_islocal* is an array.

I think this is a simple typo.
Fix using array notation access.

Trivial patch attached.

best regards,
Ranier Vilela


Attachments:

  [application/octet-stream] fix_array_access_pg_dump.patch (473B, ../CAEudQAo7ah=4TDheuEjtb0dsv6bHoK7uBNqv53Tsub2h-xBSJw@mail.gmail.com/3-fix_array_access_pg_dump.patch)
  download | inline diff:
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index a8c141b689..404f5d8675 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -9397,7 +9397,7 @@ determineNotNullFlags(Archive *fout, PGresult *res, int r,
 			 */
 			if (dopt->binary_upgrade &&
 				!tbinfo->ispartition &&
-				!tbinfo->notnull_islocal)
+				!tbinfo->notnull_islocal[j])
 			{
 				tbinfo->notnull_constrs[j] =
 					pstrdup(PQgetvalue(res, r, i_notnull_name));


view thread (8+ messages)  latest in thread

reply

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: [email protected]
  Cc: [email protected]
  Subject: Re: Fix array access (src/bin/pg_dump/pg_dump.c)
  In-Reply-To: <CAEudQAo7ah=4TDheuEjtb0dsv6bHoK7uBNqv53Tsub2h-xBSJw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox