diff options
| author | Noah Misch | 2024-09-29 22:54:25 +0000 |
|---|---|---|
| committer | Noah Misch | 2024-09-29 22:54:29 +0000 |
| commit | db1992455569265be12efc65720cfe13ca64122c (patch) | |
| tree | 8b7cf5ed9381dcadc5421c70615435890886068f /src/backend | |
| parent | 118dfd12138fe1eb57c0720d1d67bd17500eca31 (diff) | |
Remove NULL dereference from RenameRelationInternal().
Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b,
per Coverity. Reaching this would need catalog corruption. Back-patch
to v12, like that commit.
Diffstat (limited to 'src/backend')
| -rw-r--r-- | src/backend/commands/tablecmds.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 53286b3f3f9..41017b38d41 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -3682,9 +3682,9 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo relrelation = table_open(RelationRelationId, RowExclusiveLock); reltup = SearchSysCacheLockedCopy1(RELOID, ObjectIdGetDatum(myrelid)); - otid = reltup->t_self; if (!HeapTupleIsValid(reltup)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for relation %u", myrelid); + otid = reltup->t_self; relform = (Form_pg_class) GETSTRUCT(reltup); if (get_relname_relid(newrelname, namespaceId) != InvalidOid) |
