|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-03-26 15:46 UTC] pierre dot php at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 21:00:02 2025 UTC |
Description: ------------ In function _mmc_open it is possible that a member of a 'struct timeval tv' will not get initialized. With PHP 5 it doesn`t matter really(there is no select) but in PHP series 4 it may cause an endless loop beacause the uninitialized value of a timeout sometimes causes select to fail. PHP`s 4 code () is not prepared for select`s return values smaller than 0 and loops endlessly. Reproduce code: --------------- Endless loop takes place at: ./main/network.c:1015 patch fixing this issue: diff -Nwrup ./memcache-2.2.5_orig/memcache.c ./memcache-2.2.5/memcache.c --- ./memcache-2.2.5_orig/memcache.c 2009-02-27 18:45:12.000000000 +0100 +++ ./memcache-2.2.5/memcache.c 2010-03-26 21:17:51.000000000 +0100 @@ -922,6 +922,7 @@ static int _mmc_open(mmc_t *mmc, char ** tv = _convert_timeoutms_to_ts(mmc->connect_timeoutms); } else { tv.tv_sec = mmc->timeout; + tv.tv_usec = 0; } if (mmc->port) {