From f448b0e6dd3a1bd3a009c2e94c539a038f834c4d Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 1 Mar 2021 18:14:26 +0100 Subject: Fix #80817: dba_popen() may cause segfault during RSHUTDOWN We need to close persistent streams with the proper flag. --- NEWS | 3 +++ ext/dba/dba.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 264991b16b..0766c632b1 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,9 @@ PHP NEWS (Nikita) . Fixed bug #75776 (Flushing streams with compression filter is broken). (cmb) +- Dba: + . Fixed bug #80817 (dba_popen() may cause segfault during RSHUTDOWN). (cmb) + - Intl: . Fixed bug #80763 (msgfmt_format() does not accept DateTime references). (cmb) diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 952993582b..9581a57148 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -972,9 +972,9 @@ restart: zend_bool close_both; close_both = (info->fp != info->lock.fp); - php_stream_close(info->lock.fp); + php_stream_free(info->lock.fp, persistent ? PHP_STREAM_FREE_CLOSE_PERSISTENT : PHP_STREAM_FREE_CLOSE); if (close_both) { - php_stream_close(info->fp); + php_stream_free(info->fp, persistent ? PHP_STREAM_FREE_CLOSE_PERSISTENT : PHP_STREAM_FREE_CLOSE); } info->fp = NULL; info->lock.fp = NULL; -- cgit v1.2.1