]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #31480 (Possible infinite loop in imap_mail_compose()).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 18 Jan 2005 16:34:04 +0000 (16:34 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 18 Jan 2005 16:34:04 +0000 (16:34 +0000)
NEWS
ext/imap/php_imap.c

diff --git a/NEWS b/NEWS
index 6d6a1be0a4938c2b19bf7f2d1425bcfd8b294309..2fc6aa838800f5f7131031bd9ef3cdb481357aea 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ PHP 4                                                                      NEWS
 - Fixed MacOSX shared extensions crashing on Apache startup. (Rasmus)
 - Added Oracle Instant Client support. (cjbj at hotmail dot com, Tony)
 - Fixed bug #31580 (fgetcsv() problematic with "" escape sequences). (Ilia)
+- Fixed bug #31480 (Possible infinite loop in imap_mail_compose()). (Ilia)
 - Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > strlen). (Ilia)
 - Fixed bug #31454 (session_set_save_handler crashes PHP when supplied
   non-existent object ref). (Tony)
index 19bbf33c2b44966d9578054c547c1416e7a3d6dd..e7a3381b3c383abd118431075670e39388c49e17 100644 (file)
@@ -3060,7 +3060,7 @@ PHP_FUNCTION(imap_mail_compose)
                                bod->contents.text.size = Z_STRLEN_PP(pvalue);
                        } else {
                                bod->contents.text.data = (char *) fs_get(1);
-                               bod->contents.text.data = "";
+                               memcpy(bod->contents.text.data, "", 1);
                                bod->contents.text.size = 0;
                        }
                        if (zend_hash_find(Z_ARRVAL_PP(data), "lines", sizeof("lines"), (void **) &pvalue)== SUCCESS) {
@@ -3075,9 +3075,8 @@ PHP_FUNCTION(imap_mail_compose)
                                convert_to_string_ex(pvalue);
                                bod->md5 = cpystr(Z_STRVAL_PP(pvalue));
                        }
-
-                       zend_hash_move_forward(Z_ARRVAL_PP(body));
                }
+               zend_hash_move_forward(Z_ARRVAL_PP(body));
        }
 
        rfc822_encode_body_7bit(env, topbod);