From: Antony Dovgal Date: Thu, 15 Dec 2005 22:49:22 +0000 (+0000) Subject: MFH: fix #35692(iconv_mime_decode() segfault, with libiconv only) X-Git-Tag: php-5.1.2RC1~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33c87b395f805c5402b82c4cbe93532fb29c8c14;p=php MFH: fix #35692(iconv_mime_decode() segfault, with libiconv only) --- diff --git a/NEWS b/NEWS index 0991fdfe16..1d179f8e1b 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,8 @@ PHP NEWS - Fixed crash and leak in mysqli when using 4.1.x client libraries and connecting to 5.x server. (Andrey) - Fixed bug #35694 (Improved error message for invalid fetch mode). (Ilia) +- Fixed bug #35692 (iconv_mime_decode() segmentation fault; with libiconv + only). (Tony) - Fixed bug #35690 (pack() tries to allocate huge memory block when packing float values to strings). (Tony) - Fixed bug #35655 (whitespace following end of heredoc is lost). (Ilia) diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index ef88c5f258..3ad87b4d78 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1366,7 +1366,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st if (cd == (iconv_t)(-1)) { if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd); + err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { goto out; }