Skip to content

Commit 2b90acb

Browse files
committed
Fix phpGH-15986: Double-free due to Pdo\Pgsql::setNoticeCallback()
We need to release the fcall info cache instead of destroying it. Closes phpGH-15987.
1 parent 79d708c commit 2b90acb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ PHP NEWS
3030
- PCRE:
3131
. Fix UAF issues with PCRE after request shutdown. (nielsdos)
3232

33+
- PDO_PGSQL:
34+
. Fixed GH-15986 (Double-free due to Pdo\Pgsql::setNoticeCallback()). (cmb,
35+
nielsdos)
36+
3337
- Reflection:
3438
. Add missing ReflectionProperty::hasHook[s]() methods. (ilutov)
3539
. Add missing ReflectionProperty::isFinal() method. (ilutov)

ext/pdo_pgsql/pdo_pgsql.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ PHP_METHOD(Pdo_Pgsql, setNoticeCallback)
169169
return;
170170

171171
cleanup:
172-
if (ZEND_FCC_INITIALIZED(fcc)) {
173-
zend_fcc_dtor(&fcc);
174-
}
172+
zend_release_fcall_info_cache(&fcc);
175173
RETURN_THROWS();
176174
}
177175

0 commit comments

Comments
 (0)