From: andrew at lifescale dot com Operating system: FreeBSD 6.1 PHP version: 5.2.6 PHP Bug Type: IMAP related Bug description: imap patch for fromlength fix in imap_headerinfo doesn't accept lengths of 1024
Description: ------------ There was a patch on April 1 for imap.c that added a sanity check to the from and subject lengths when calling imap_headerinfo() http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.247&r2=1.248 The error message says that the from / subject lengths have to be between 1 and 1024. However it will not accept a fromlength of 1024 due to the >= operator. MAILTMPLEN is 1024 This causes a problem for the pear library IMAPv2 as it defaults the fromlength and subjectlength to 1024 Either the error message must be updated to MAILTMPLEN-1, or the operator and char array must be changed (this is preferred as to not bust IMAPv2) Reproduce code: --------------- I don't have a good example as I use IMAPv2. However, it seems like a simple problem just by looking at the code Expected result: ---------------- imap_headerinfo should accept a fromlength of 1024 Actual result: -------------- A warning is given: Jul 8 00:01:49 php: PHP Warning: imap_headerinfo(): From length has to be between 1 and 1024 in /usr/local/lib/php/Mail/IMAPv2.php on line 1505 -- Edit bug report at http://bugs.php.net/?id=45460&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45460&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45460&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45460&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45460&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45460&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45460&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45460&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45460&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45460&r=support Expected behavior: http://bugs.php.net/fix.php?id=45460&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45460&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45460&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45460&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45460&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45460&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45460&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45460&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45460&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45460&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45460&r=mysqlcfg
