diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2004-01-15 00:35:04 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2004-01-15 00:35:04 +0000 |
commit | 827a79ad8d53ce8566f7e8744512decad67c79da (patch) | |
tree | 284b840dfd8e9c2642921eaa56bc1848c34bd29b /ext/imap/php_imap.c | |
parent | 7dc2bf36050091ead6ce9259449f456db0306906 (diff) | |
download | php-git-827a79ad8d53ce8566f7e8744512decad67c79da.tar.gz |
Fixed bug #26909 (crash in imap_mime_header_decode() when no encoding is
used).
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r-- | ext/imap/php_imap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index fd0ddbce2e..97d54f8546 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -3607,8 +3607,12 @@ PHP_FUNCTION(imap_mime_header_decode) add_property_string(myobject, "charset", charset, 1); add_property_string(myobject, "text", decode, 1); zend_hash_next_index_insert(Z_ARRVAL_P(return_value), (void *)&myobject, sizeof(zval *), NULL); - fs_give((void**)&decode); - + + /* only free decode if it was allocated by rfc822_qprint or rfc822_base64 */ + if (decode != text) { + fs_give((void**)&decode); + } + offset = end_token+2; for (i = 0; (string[offset + i] == ' ') || (string[offset + i] == 0x0a) || (string[offset + i] == 0x0d); i++); if ((string[offset + i] == '=') && (string[offset + i + 1] == '?') && (offset + i < end)) { |