diff options
author | Stanislav Malyshev <stas@php.net> | 2019-04-29 22:09:10 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2019-04-29 22:09:10 -0700 |
commit | 506a764089ba82457345b334bfb0b8d80727ae2f (patch) | |
tree | 5d3784bfb1c608563341a411228cca68f9a3051b | |
parent | a30b919872f503f8dbe551195b4cb5fec2d91d42 (diff) | |
parent | 2c3933821fe2d401ae128f25047935671c43dd98 (diff) | |
download | php-git-506a764089ba82457345b334bfb0b8d80727ae2f.tar.gz |
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
Fix #77821: Potential heap corruption in TSendMail()
-rw-r--r-- | win32/sendmail.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c index 509dc605c9..ea693ae1f9 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -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; |