Bug #72324 [NEW]: imap_mailboxmsginfo() return wrong size

From: Date: Fri, 03 Jun 2016 08:50:31 +0000
Subject: Bug #72324 [NEW]: imap_mailboxmsginfo() return wrong size
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201416@lists.php.net to get a copy of this message
From: ronaldpoon at udomain dot com dot hk Operating system: Any PHP version: Irrelevant Package: IMAP related Bug Type: Bug Bug description:imap_mailboxmsginfo() return wrong size Description: ------------ When mailbox or subfolder larger than 4G, the imap_mailboxmsginfo() will return wrong size. It is because the msize for accumulate the RFC822.SIZE overflow beyond 4G due to 32bit integer. By changing the unsigned int to unsigned long, the msize will be calculated correctly. --- ext/imap/php_imap.c.orig 2016-06-03 16:39:44.387619879 +0800 +++ ext/imap/php_imap.c 2016-06-03 16:40:10.484287296 +0800 @@ -2601,7 +2601,7 @@ PHP_FUNCTION(imap_mailboxmsginfo) zval *streamind; pils *imap_le_struct; char date[100]; - unsigned int msgno, unreadmsg, deletedmsg, msize; + unsigned long msgno, unreadmsg, deletedmsg, msize; if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) { return; -- Edit bug report at https://bugs.php.net/bug.php?id=72324&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72324&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72324&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72324&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=72324&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=72324&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=72324&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=72324&r=needscript Try newer version: https://bugs.php.net/fix.php?id=72324&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=72324&r=support Expected behavior: https://bugs.php.net/fix.php?id=72324&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=72324&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=72324&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=72324&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72324&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=72324&r=dst IIS Stability: https://bugs.php.net/fix.php?id=72324&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=72324&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=72324&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=72324&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=72324&r=mysqlcfg

« previous php.bugs (#201416) next »