Skip to content

Commit f448b0e

Browse files
committed
Fix #80817: dba_popen() may cause segfault during RSHUTDOWN
We need to close persistent streams with the proper flag.
1 parent 282355e commit f448b0e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ PHP NEWS
77
(Nikita)
88
. Fixed bug #75776 (Flushing streams with compression filter is broken). (cmb)
99

10+
- Dba:
11+
. Fixed bug #80817 (dba_popen() may cause segfault during RSHUTDOWN). (cmb)
12+
1013
- Intl:
1114
. Fixed bug #80763 (msgfmt_format() does not accept DateTime references).
1215
(cmb)

ext/dba/dba.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,9 +972,9 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
972972
zend_bool close_both;
973973

974974
close_both = (info->fp != info->lock.fp);
975-
php_stream_close(info->lock.fp);
975+
php_stream_free(info->lock.fp, persistent ? PHP_STREAM_FREE_CLOSE_PERSISTENT : PHP_STREAM_FREE_CLOSE);
976976
if (close_both) {
977-
php_stream_close(info->fp);
977+
php_stream_free(info->fp, persistent ? PHP_STREAM_FREE_CLOSE_PERSISTENT : PHP_STREAM_FREE_CLOSE);
978978
}
979979
info->fp = NULL;
980980
info->lock.fp = NULL;

0 commit comments

Comments
 (0)