mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Remove NULL dereference from RenameRelationInternal().
Defect in last week's commit aac2c9b4fd
,
per Coverity. Reaching this would need catalog corruption. Back-patch
to v12, like that commit.
This commit is contained in:
@ -3861,9 +3861,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)
|
||||
|
Reference in New Issue
Block a user