Skip to content

Commit da99df1

Browse files
committed
Remove NULL dereference from RenameRelationInternal().
Defect in last week's commit aac2c9b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit.
1 parent 4aad471 commit da99df1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/commands/tablecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4143,9 +4143,9 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo
41434143
relrelation = table_open(RelationRelationId, RowExclusiveLock);
41444144

41454145
reltup = SearchSysCacheLockedCopy1(RELOID, ObjectIdGetDatum(myrelid));
4146-
otid = reltup->t_self;
41474146
if (!HeapTupleIsValid(reltup)) /* shouldn't happen */
41484147
elog(ERROR, "cache lookup failed for relation %u", myrelid);
4148+
otid = reltup->t_self;
41494149
relform = (Form_pg_class) GETSTRUCT(reltup);
41504150

41514151
if (get_relname_relid(newrelname, namespaceId) != InvalidOid)

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