iliaa Wed Apr 2 16:29:08 2008 UTC
Modified files:
/php-src/ext/imap php_imap.c
Log:
MFB: Fixed bug #44613 (Crash inside imap_headerinfo())
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.247&r2=1.248&diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.247 php-src/ext/imap/php_imap.c:1.248
--- php-src/ext/imap/php_imap.c:1.247 Tue Apr 1 18:48:41 2008
+++ php-src/ext/imap/php_imap.c Wed Apr 2 16:29:08 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates: Zeev Suraski <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.c,v 1.247 2008/04/01 18:48:41 felipe Exp $ */
+/* $Id: php_imap.c,v 1.248 2008/04/02 16:29:08 iliaa Exp $ */
#define IMAP41
@@ -1589,8 +1589,8 @@
convert_to_long_ex(msgno);
if (myargc >= 3) {
convert_to_long_ex(fromlength);
- if (Z_LVAL_PP(fromlength) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "From
length has to be greater than or equal to 0");
+ if (Z_LVAL_PP(fromlength) < 0 || Z_LVAL_PP(fromlength) >=
MAILTMPLEN) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "From
length has to be between 1 and %i", MAILTMPLEN);
RETURN_FALSE;
}
} else {
@@ -1598,8 +1598,8 @@
}
if (myargc >= 4) {
convert_to_long_ex(subjectlength);
- if (Z_LVAL_PP(subjectlength) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject
length has to be greater than or equal to 0");
+ if (Z_LVAL_PP(subjectlength) < 0 || Z_LVAL_PP(subjectlength) >=
MAILTMPLEN) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject
length has to be between 1 and %i", MAILTMPLEN);
RETURN_FALSE;
}
} else {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php