mirror of
https://github.com/php/php-src.git
synced 2024-12-14 04:16:30 +08:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #77821: Potential heap corruption in TSendMail()
This commit is contained in:
commit
f7d59844e1
@ -252,8 +252,9 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message,
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
if (headers_lc) {
|
||||
zend_string_free(headers_lc);
|
||||
if (headers) {
|
||||
zend_string_release(headers_trim);
|
||||
zend_string_release(headers_lc);
|
||||
}
|
||||
*error = W32_SM_SENDMAIL_FROM_NOT_SET;
|
||||
return FAILURE;
|
||||
@ -267,8 +268,8 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message,
|
||||
efree(RPath);
|
||||
}
|
||||
if (headers) {
|
||||
zend_string_free(headers_trim);
|
||||
zend_string_free(headers_lc);
|
||||
zend_string_release(headers_trim);
|
||||
zend_string_release(headers_lc);
|
||||
}
|
||||
/* 128 is safe here, the specifier in snprintf isn't longer than that */
|
||||
*error_message = ecalloc(1, HOST_NAME_LEN + 128);
|
||||
@ -284,8 +285,8 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message,
|
||||
efree(RPath);
|
||||
}
|
||||
if (headers) {
|
||||
zend_string_free(headers_trim);
|
||||
zend_string_free(headers_lc);
|
||||
zend_string_release(headers_trim);
|
||||
zend_string_release(headers_lc);
|
||||
}
|
||||
if (ret != SUCCESS) {
|
||||
*error = ret;
|
||||
|
Loading…
Reference in New Issue
Block a user