|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46731 Imap FT_UID handling problem
Submitted: 2008-12-02 16:04 UTC Modified: 2008-12-05 16:06 UTC
From: zoe dot slattery at googlemail dot com Assigned: zoe
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3CVS-2008-12-02 (snap) OS: Linux
Private report: No CVE-ID:
 [2008-12-02 16:04 UTC] zoe dot slattery at googlemail dot com
In imap_fetch_overview() the FT_UID parameter is treated as a bitmap. This means that giving it completely invalid parameters for FT_UID does not cause an error.

Suggested fix to imap_fetch_overview() is here:

Reproduce code:
To run this you would need the file that is in ~ext/imap/tests.

Expected result:
From this code I'd expect two successful fetches followed by two failures.

Actual result:
Four successful fetches, PHP_INT_MAX and PHP_INT_MAX-1 are interpreted as 1 and 0 respectively.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-03 01:04 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2008-12-03 15:16 UTC] zoe dot slattery at googlemail dot com
Ilia - thanks but your fix doesn't fix it :-).

Your fix will pass any number as long as it ends in a 1, and warn on any non-zero number that ends in a zero.

The fix I suggested will warn about any number that isn't either 0 or 1 (FT_UID). These are the only valid values.
 [2008-12-05 16:06 UTC] zoe dot slattery at googlemail dot com
Fixed in PHP5.2, PHP5.3 and PHP6
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Wed Nov 25 18:01:40 2015 UTC