From: Fujii Masao Date: Thu, 4 Sep 2014 17:17:57 +0000 (+0900) Subject: Fix segmentation fault that an empty prepared statement could cause. X-Git-Tag: REL9_4_BETA3~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6da740e72ebfe22cb2a40bf9ebd775531a2294a6;p=postgresql Fix segmentation fault that an empty prepared statement could cause. Back-patch to all supported branches. Per bug #11335 from Haruka Takatsuka --- diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 0558ea34b0..18c74525fa 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -2452,6 +2452,9 @@ GetCommandLogLevel(Node *parsetree) { LogStmtLevel lev; + if (parsetree == NULL) + return LOGSTMT_ALL; + switch (nodeTag(parsetree)) { /* raw plannable queries */