Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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:45 +0000 (02:19 +0900)
Back-patch to all supported branches.

Per bug #11335 from Haruka Takatsuka

src/backend/tcop/utility.c

index c76e7bb0fecdacb75bfc02a0dfb4bbb56ffbafca..81e832506afd8b87b7f613343c9c0b5801cc3ed7 100644 (file)
@@ -2184,6 +2184,9 @@ GetCommandLogLevel(Node *parsetree)
 {
    LogStmtLevel lev;
 
+   if (parsetree == NULL)
+       return LOGSTMT_ALL;
+
    switch (nodeTag(parsetree))
    {
            /* raw plannable queries */