php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #78069
Patch iconv_patch.diff revision 2019-05-26 14:36 UTC by maris dot adam at gmail dot com

Patch iconv_patch.diff for ICONV related Bug #78069

Patch version 2019-05-26 14:36 UTC

Return to Bug #78069 | Download this patch
Patch Revisions:

Developer: maris.adam@gmail.com

diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index f064b65290..bb40b6a215 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -1648,7 +1648,9 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 							 * we can do at this point. */
 							if (*(p1 + 1) == '=') {
 								++p1;
-								--str_left;
+								if (str_left > 1) {
+									--str_left;
+								}
 							}
 
 							err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC