From: Stanislav Malyshev Date: Mon, 3 Dec 2018 08:39:03 +0000 (-0800) Subject: Merge branch 'PHP-5.6' into PHP-7.0 X-Git-Tag: php-7.0.33~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66a0f061f62410ccab6420ea1ccfc6b7652c7e83;p=php Merge branch 'PHP-5.6' into PHP-7.0 * PHP-5.6: Fix bug #77143 - add more checks to buffer reads Fix #77020: null pointer dereference in imap_mail --- 66a0f061f62410ccab6420ea1ccfc6b7652c7e83 diff --cc ext/imap/php_imap.c index 33a68a7a18,b30440f000..011cbc0dfd --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@@ -4125,14 -4091,12 +4125,13 @@@ PHP_FUNCTION(imap_mail } /* message body */ - if (!message_len) { + if (!ZSTR_LEN(message)) { /* this is not really an error, so it is allowed. */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message string in mail command"); + php_error_docref(NULL, E_WARNING, "No message string in mail command"); - message = NULL; } - if (_php_imap_mail(to, subject, message, headers, cc, bcc, rpath TSRMLS_CC)) { + if (_php_imap_mail(ZSTR_VAL(to), ZSTR_VAL(subject), ZSTR_VAL(message), headers?ZSTR_VAL(headers):NULL, cc?ZSTR_VAL(cc):NULL, + bcc?ZSTR_VAL(bcc):NULL, rpath?ZSTR_VAL(rpath):NULL)) { RETURN_TRUE; } else { RETURN_FALSE;