From: Ilia Alshanetsky Date: Tue, 5 Apr 2005 14:48:28 +0000 (+0000) Subject: MFH: Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets). X-Git-Tag: php-5.0.5RC1~482 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee70304a32efed6bedfb2669d7693655e99875e1;p=php MFH: Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets). --- diff --git a/NEWS b/NEWS index 22af5bc5c6..0b430093d9 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2005, PHP 5.0.5 +- Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets). + (Ilia) - Fixed bug #32560 (configure looks for incorrect db2 library). (Tony) - Fixed bug #32530 (chunk_split() does not append endstr if chunklen is longer then the original string). (Ilia) diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index ba3db05785..b4bf2072de 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -3045,7 +3045,8 @@ PHP_FUNCTION(imap_mail_compose) if (zend_hash_find(Z_ARRVAL_PP(data), "charset", sizeof("charset"), (void **) &pvalue)== SUCCESS) { convert_to_string_ex(pvalue); tmp_param = mail_newbody_parameter(); - tmp_param->value = cpystr(Z_STRVAL_PP(pvalue)); + tmp_param->value = (char *) fs_get(Z_STRLEN_PP(pvalue) + 1); + memcpy(disp_param->value, Z_STRVAL_PP(pvalue), Z_STRLEN_PP(pvalue) + 1); tmp_param->attribute = "CHARSET"; tmp_param->next = bod->parameter; bod->parameter = tmp_param;