summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera2016-04-10 14:03:35 +0000
committerAlvaro Herrera2016-04-10 14:03:35 +0000
commitbd905a0d0416628b4aef153463c1f5e5b80b3e96 (patch)
tree1cbc6be00e27cf8fa254b2b93b2201e69e56ac3b
parent660d5fb856c61df2de2cedb26249404ffc58cb89 (diff)
Fix possible NULL dereference in ExecAlterObjectDependsStmt
I used the wrong variable here. Doesn't make a difference today because the only plausible caller passes a non-NULL variable, but someday it will be wrong, and even today's correctness is subtle: the caller that does pass a NULL is never invoked because of object type constraints. Surely not a condition to rely on. Noted by Coverity
-rw-r--r--src/backend/commands/alter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c
index 27b7579592..47a5c50132 100644
--- a/src/backend/commands/alter.c
+++ b/src/backend/commands/alter.c
@@ -422,7 +422,7 @@ ExecAlterObjectDependsStmt(AlterObjectDependsStmt *stmt, ObjectAddress *refAddre
if (refAddress)
*refAddress = refAddr;
- recordDependencyOn(&address, refAddress, DEPENDENCY_AUTO_EXTENSION);
+ recordDependencyOn(&address, &refAddr, DEPENDENCY_AUTO_EXTENSION);
return address;
}