postgres.git / summary / log / commit / refs
commit bd905a0d0416628b4aef153463c1f5e5b80b3e96
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Sun Apr 10 14:03:35 2016 +0000
First released in: 9.6.0
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
src/backend/commands/alter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c
index 27b75795928..47a5c501320 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;
}
[parent: 660d5fb856c6]