From 6da740e72ebfe22cb2a40bf9ebd775531a2294a6 Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Fri, 5 Sep 2014 02:17:57 +0900 Subject: [PATCH] Fix segmentation fault that an empty prepared statement could cause. Back-patch to all supported branches. Per bug #11335 from Haruka Takatsuka --- src/backend/tcop/utility.c | 3 +++ 1 file changed, 3 insertions(+) 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 */ -- 2.40.0