Content-Length: 288207 | pFad | https://github.com/postgrespro/postgres/commit/2e9650cbcff8c8fb0d9ef807c73a44f241822eee

D0 Defend against null input in analyze_requires_snapshot(), per report · postgrespro/postgres@2e9650c · GitHub
Skip to content

Commit 2e9650c

Browse files
committed
Defend against null input in analyze_requires_snapshot(), per report
from Rushabh Lathia.
1 parent 3467f02 commit 2e9650c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/backend/parser/analyze.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
1818
* Portions Copyright (c) 1994, Regents of the University of California
1919
*
20-
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.386 2009/01/01 17:23:45 momjian Exp $
20+
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.387 2009/01/08 13:42:33 tgl Exp $
2121
*
2222
*-------------------------------------------------------------------------
2323
*/
@@ -222,13 +222,17 @@ transformStmt(ParseState *pstate, Node *parseTree)
222222
* Returns true if a snapshot must be set before doing parse analysis
223223
* on the given raw parse tree.
224224
*
225-
* Classification here should match transformStmt().
225+
* Classification here should match transformStmt(); but we also have to
226+
* allow a NULL input (for Parse/Bind of an empty query string).
226227
*/
227228
bool
228229
analyze_requires_snapshot(Node *parseTree)
229230
{
230231
bool result;
231232

233+
if (parseTree == NULL)
234+
return false;
235+
232236
switch (nodeTag(parseTree))
233237
{
234238
/*

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/postgrespro/postgres/commit/2e9650cbcff8c8fb0d9ef807c73a44f241822eee

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy