]> granicus.if.org Git - php/commitdiff
- MFB: Fixed bug #45460 (imap patch for fromlength fix in imap_headerinfo doesn't...
authorFelipe Pena <felipe@php.net>
Thu, 10 Jul 2008 17:50:51 +0000 (17:50 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 10 Jul 2008 17:50:51 +0000 (17:50 +0000)
ext/imap/php_imap.c

index e377eb27a86647015fafeab3c58aa60f6f9c1bf7..c09d7e8380b63de2226d83cb97562fa84143bfb7 100644 (file)
@@ -1977,16 +1977,16 @@ PHP_FUNCTION(imap_headerinfo)
        ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
 
        if (argc >= 3) {
-               if (fromlength < 0 || fromlength >= MAILTMPLEN) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "From length has to be between 1 and %i", MAILTMPLEN);
+               if (fromlength < 0 || fromlength > MAILTMPLEN) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "From length has to be between 0 and %d", MAILTMPLEN);
                        RETURN_FALSE;
                }
        } else {
                fromlength = 0x00;
        }
        if (argc >= 4) {
-               if (subjectlength < 0 || subjectlength >= MAILTMPLEN) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject length has to be between 1 and %i", MAILTMPLEN);
+               if (subjectlength < 0 || subjectlength > MAILTMPLEN) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject length has to be between 0 and %d", MAILTMPLEN);
                        RETURN_FALSE;
                }
        } else {