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_1_15~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81bffe63c09aac9e64932250082df86bbdc9fd13;p=thirdparty%2Fpostgresql.git 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 c096b52bfd6..2d065b99f3c 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -2308,6 +2308,9 @@ GetCommandLogLevel(Node *parsetree) { LogStmtLevel lev; + if (parsetree == NULL) + return LOGSTMT_ALL; + switch (nodeTag(parsetree)) { /* raw plannable queries */