summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-12-20 11:45:50 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-12-20 11:45:50 +0100
commit566b356ecac6cf9b18bd9d5112475a4aff488148 (patch)
tree5da3ed49406d949717ca01dc8299888686492dc8 /ext/pdo_pgsql
parent5902b35f857a6564c0c5b67a40e84005a406fbb3 (diff)
parentf974f252ddf47da1294a813ffb60e82f3638186c (diff)
downloadphp-git-566b356ecac6cf9b18bd9d5112475a4aff488148.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #78980: pgsqlGetNotify() overlooks dead connection
Diffstat (limited to 'ext/pdo_pgsql')
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index d186cb1f5e..ffa6c77646 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -1068,13 +1068,21 @@ static PHP_METHOD(PDO, pgsqlGetNotify)
H = (pdo_pgsql_db_handle *)dbh->driver_data;
- PQconsumeInput(H->server);
+ if (!PQconsumeInput(H->server)) {
+ pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
pgsql_notify = PQnotifies(H->server);
if (ms_timeout && !pgsql_notify) {
php_pollfd_for_ms(PQsocket(H->server), PHP_POLLREADABLE, (int)ms_timeout);
- PQconsumeInput(H->server);
+ if (!PQconsumeInput(H->server)) {
+ pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
pgsql_notify = PQnotifies(H->server);
}