]> granicus.if.org Git - postgresql/commitdiff
Fix segmentation fault that an empty prepared statement could cause.
authorFujii Masao <fujii@postgresql.org>
Thu, 4 Sep 2014 17:17:57 +0000 (02:17 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 4 Sep 2014 17:19:57 +0000 (02:19 +0900)
Back-patch to all supported branches.

Per bug #11335 from Haruka Takatsuka

src/backend/tcop/utility.c

index 1740ff9f0abef727f8ffdc922dd8f81d56ef61f3..5acfa31b30126c05483f990a801a606a55ee8922 100644 (file)
@@ -2262,6 +2262,9 @@ GetCommandLogLevel(Node *parsetree)
 {
        LogStmtLevel lev;
 
+       if (parsetree == NULL)
+               return LOGSTMT_ALL;
+
        switch (nodeTag(parsetree))
        {
                        /* raw plannable queries */