Skip to content

Commit f974f25

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #78980: pgsqlGetNotify() overlooks dead connection
2 parents 10eb0b3 + 7e39e69 commit f974f25

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

NEWS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ PHP NEWS
1313
. Fixed bug #78999 (Cycle leak when using function result as temporary).
1414
(Dmitry)
1515

16+
- Fileinfo:
17+
. Fixed bug #74170 (locale information change after mime_content_type).
18+
(Sergei Turchanov)
19+
1620
- OPcache:
1721
. Fixed bug #78961 (erroneous optimization of re-assigned $GLOBALS). (Dmitry)
1822
. Fixed bug #78950 (Preloading trait method with static variables). (Nikita)
@@ -21,9 +25,15 @@ PHP NEWS
2125
. Fixed bug #78986 (Opcache segfaults when inheriting ctor from immutable
2226
into mutable class). (Nikita)
2327

28+
- Pcntl:
29+
. Fixed bug #78402 (Converting null to string in error message is bad DX).
30+
(SATŌ Kentarō)
31+
2432
- PDO_PgSQL:
2533
. Fixed bug #78983 (pdo_pgsql config.w32 cannot find libpq-fe.h). (SATŌ
2634
Kentarō)
35+
. Fixed bug #78980 (pgsqlGetNotify() overlooks dead connection). (SATŌ
36+
Kentarō)
2737

2838
- Spl:
2939
. Fixed bug #78976 (SplFileObject::fputcsv returns -1 on failure). (cmb)

ext/pdo_pgsql/pgsql_driver.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,13 +1068,21 @@ static PHP_METHOD(PDO, pgsqlGetNotify)
10681068

10691069
H = (pdo_pgsql_db_handle *)dbh->driver_data;
10701070

1071-
PQconsumeInput(H->server);
1071+
if (!PQconsumeInput(H->server)) {
1072+
pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL);
1073+
PDO_HANDLE_DBH_ERR();
1074+
RETURN_FALSE;
1075+
}
10721076
pgsql_notify = PQnotifies(H->server);
10731077

10741078
if (ms_timeout && !pgsql_notify) {
10751079
php_pollfd_for_ms(PQsocket(H->server), PHP_POLLREADABLE, (int)ms_timeout);
10761080

1077-
PQconsumeInput(H->server);
1081+
if (!PQconsumeInput(H->server)) {
1082+
pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL);
1083+
PDO_HANDLE_DBH_ERR();
1084+
RETURN_FALSE;
1085+
}
10781086
pgsql_notify = PQnotifies(H->server);
10791087
}
10801088

0 commit comments

Comments
 (0)