Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #80226: imap_sort() leaks sortpgm memory
This commit is contained in:
Christoph M. Becker 2020-10-12 23:17:42 +02:00
commit 12fc8f66e7
3 changed files with 15 additions and 0 deletions

1
NEWS
View File

@ -21,6 +21,7 @@ PHP NEWS
(cmb)
. Fixed bug #80216 (imap_mail_compose() does not validate types/encodings).
(cmb)
. Fixed bug #80226 (imap_sort() leaks sortpgm memory). (cmb)
- MySQLnd:
. Fixed bug #80115 (mysqlnd.debug doesn't recognize absolute paths with

View File

@ -3201,6 +3201,7 @@ PHP_FUNCTION(imap_sort)
slst = mail_sort(imap_le_struct->imap_stream, (argc == 6 ? ZSTR_VAL(charset) : NIL), spg, mypgm, (argc >= 4 ? flags : NIL));
mail_free_sortpgm(&mypgm);
if (spg && !(flags & SE_FREE)) {
mail_free_searchpgm(&spg);
}

View File

@ -0,0 +1,13 @@
--TEST--
Bug #80226 (imap_sort() leaks sortpgm memory)
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/imap_include.inc');
$stream = imap_open($default_mailbox, $username, $password);
imap_sort($stream, SORTFROM, 0);
?>
--EXPECT--