scripts hangs on netx() prev()
| Bug #35067 | scripts hangs on netx() prev() | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2005-11-02 15:46 UTC | Modified: | 2005-11-02 22:07 UTC |
|
||||||||||
| From: | baroiller at aoditu dot com | Assigned: | ||||||||||||
| Status: | Closed | Package: | *General Issues | |||||||||||
| PHP Version: | 4.4.1 | OS: | linux redhat 7.2 | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2005-11-02 15:46 UTC] baroiller at aoditu dot com
Description:
------------
Many "open source" softwares like phpadsnew, and squiremail ( i've got problems on theses ), hangs.
after looking into their code, i've found that all fuctions reset(), next(), prev() hangs when passed value is'nt an array.
Reproduce code:
---------------
code sample (all latest versions) :
// phpAdsNew
if (phpAds_isUser(phpAds_Admin))
$pages[] = $phpAds_nav['admin'];
elseif (phpAds_isUser(phpAds_Client))
$pages[] = $phpAds_nav['client'];
elseif (phpAds_isUser(phpAds_Affiliate))
$pages[] = $phpAds_nav['affiliate'];
else
$pages = array();
for (reset($pages);$key=key($pages);next($pages))
{
//// .... ////
}
// squireMail
if (is_array($msort)) {
for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
//// ... ////
}
Actual result:
--------------
added $pages = array() for phpadsnew ( bug fixed )
but, put code into comments onto squiremail ( don't have any time...)
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2005-11-02 18:58 UTC] iliaa@php.net
[2005-11-02 22:07 UTC] baroiller at aoditu dot com