diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-01-08 13:42:33 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-01-08 13:42:33 +0000 |
commit | 2e9650cbcff8c8fb0d9ef807c73a44f241822eee (patch) | |
tree | c4fc1132707b441ede35f0d1ffbe4c4e486e51a3 /src/backend/parser | |
parent | 3467f029571bbc7cd5c76f3fb7fb36b7fe79a049 (diff) | |
download | postgresql-2e9650cbcff8c8fb0d9ef807c73a44f241822eee.tar.gz postgresql-2e9650cbcff8c8fb0d9ef807c73a44f241822eee.zip |
Defend against null input in analyze_requires_snapshot(), per report
from Rushabh Lathia.
Diffstat (limited to 'src/backend/parser')
-rw-r--r-- | src/backend/parser/analyze.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 9c896b07f68..6b54e9ba173 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -17,7 +17,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.386 2009/01/01 17:23:45 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.387 2009/01/08 13:42:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -222,13 +222,17 @@ transformStmt(ParseState *pstate, Node *parseTree) * Returns true if a snapshot must be set before doing parse analysis * on the given raw parse tree. * - * Classification here should match transformStmt(). + * Classification here should match transformStmt(); but we also have to + * allow a NULL input (for Parse/Bind of an empty query string). */ bool analyze_requires_snapshot(Node *parseTree) { bool result; + if (parseTree == NULL) + return false; + switch (nodeTag(parseTree)) { /* |