Skip to content

Commit a190738

Browse files
committed
Fix out-of-array-bounds compiler warning
Since the array length check is using a post-increment operator, the compiler complains that there's a potential write to one element beyond the end of the array. This is not possible currently: the only path to this function is through pg_get_object_address(), which already verifies that the input array is no more than two elements in length. Still, a bug is a bug. No idea why my compiler doesn't complain about this ... Pointed out by Dead Rasheed and Peter Eisentraut
1 parent a61fd53 commit a190738

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/catalog/objectaddress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ get_object_address_opf_member(ObjectType objtype,
14281428
typenames[i] = strVal(lfirst(cell));
14291429
typaddr = get_object_address_type(OBJECT_TYPE, cell, missing_ok);
14301430
typeoids[i] = typaddr.objectId;
1431-
if (i++ >= 2)
1431+
if (++i >= 2)
14321432
break;
14331433
}
14341434

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy