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.
This commit is contained in:
parent
05c4d930e1
commit
9363b329b2
@ -4143,9 +4143,9 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo
|
|||||||
relrelation = table_open(RelationRelationId, RowExclusiveLock);
|
relrelation = table_open(RelationRelationId, RowExclusiveLock);
|
||||||
|
|
||||||
reltup = SearchSysCacheLockedCopy1(RELOID, ObjectIdGetDatum(myrelid));
|
reltup = SearchSysCacheLockedCopy1(RELOID, ObjectIdGetDatum(myrelid));
|
||||||
otid = reltup->t_self;
|
|
||||||
if (!HeapTupleIsValid(reltup)) /* shouldn't happen */
|
if (!HeapTupleIsValid(reltup)) /* shouldn't happen */
|
||||||
elog(ERROR, "cache lookup failed for relation %u", myrelid);
|
elog(ERROR, "cache lookup failed for relation %u", myrelid);
|
||||||
|
otid = reltup->t_self;
|
||||||
relform = (Form_pg_class) GETSTRUCT(reltup);
|
relform = (Form_pg_class) GETSTRUCT(reltup);
|
||||||
|
|
||||||
if (get_relname_relid(newrelname, namespaceId) != InvalidOid)
|
if (get_relname_relid(newrelname, namespaceId) != InvalidOid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user