From: Noah Misch Date: Thu, 26 Apr 2018 01:50:29 +0000 (-0700) Subject: Correct pg_recvlogical server version test. X-Git-Tag: REL_11_BETA1~172 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6336b6dfc5c5f7ef746fb7b14c720ef0c2c6a1f1;p=thirdparty%2Fpostgresql.git Correct pg_recvlogical server version test. The predecessor test boiled down to "PQserverVersion(NULL) >= 100000", which is always false. No release includes that, so it could not have reintroduced CVE-2018-1058. Back-patch to 9.4, like the addition of the predecessor in commit 8d2814f274def85f39fbe997d454b01628cb5667. Discussion: https://postgr.es/m/20180422215551.GB2676194@rfd.leadboat.com --- diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c index 4fd536931b1..77ae91fbe73 100644 --- a/src/bin/pg_basebackup/streamutil.c +++ b/src/bin/pg_basebackup/streamutil.c @@ -223,7 +223,7 @@ GetConnection(void) * 10, so the search path cannot be changed (by us or attackers) on * earlier versions. */ - if (dbname != NULL && PQserverVersion(conn) >= 100000) + if (dbname != NULL && PQserverVersion(tmpconn) >= 100000) { PGresult *res;