Location via proxy:
[ UP ]
[Report a bug]
[Manage cookies]
No cookies
No scripts
No ads
No referrer
Show this form
projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4aad471
)
Remove NULL dereference from RenameRelationInternal().
author
Noah Misch
<noah@leadboat.com>
Sun, 29 Sep 2024 22:54:25 +0000
(15:54 -0700)
committer
Noah Misch
<noah@leadboat.com>
Sun, 29 Sep 2024 22:54:28 +0000
(15:54 -0700)
Defect in last week's commit
aac2c9b4fde889d13f859c233c2523345e72d32b
,
per Coverity. Reaching this would need catalog corruption. Back-patch
to v12, like that commit.
src/backend/commands/tablecmds.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/commands/tablecmds.c
b/src/backend/commands/tablecmds.c
index 9432fd6587a7bfbe0986fefbe731b43fa7b2bb6e..0ad0dfbcc57ea4b185c47707fc3bbca7de68dac5 100644
(file)
--- a/
src/backend/commands/tablecmds.c
+++ b/
src/backend/commands/tablecmds.c
@@
-4143,9
+4143,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)