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_0_19~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=857a5d6b59e0104ff0200723e617e5e9743d5532;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 1740ff9f0a..5acfa31b30 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -2262,6 +2262,9 @@ GetCommandLogLevel(Node *parsetree) { LogStmtLevel lev; + if (parsetree == NULL) + return LOGSTMT_ALL; + switch (nodeTag(parsetree)) { /* raw plannable queries */