|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-21 17:53 UTC] joy at entuzijast dot net
[2007-02-26 13:30 UTC] michael at bretterklieber dot com
[2007-02-26 15:32 UTC] joy at entuzijast dot net
[2007-03-18 16:33 UTC] michael at bretterklieber dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 17:00:01 2025 UTC |
Description: ------------ On a machine running PHP5 on a Debian GNU/Linux installation within a Xen child, I ran into a strange problem with the PHP RADIUS extension whereby all connections to the local RADIUS server would instantly fail with "No valid RADIUS responses received", regardless of settings. The problem seems to be that zend_parse_parameters() is very sensitive to its integer data types - you can't seem to write 'l's (longs) into ints. Given that I also saw what happens if one sets timeout to 0, I also made the code barf at it. I don't believe anyone has a RADIUS server which answers within 0 microseconds. :) Thanks in advance. Reproduce code: --------------- --- radius.c.orig 2003-11-17 20:45:00.000000000 +0100 +++ radius.c 2007-02-20 18:06:48.000000000 +0100 @@ -239,7 +239,8 @@ PHP_FUNCTION(radius_add_server) { char *hostname, *secret; - int hostname_len, secret_len, port, timeout, maxtries; + int hostname_len, secret_len; + long port, timeout, maxtries; radius_descriptor *raddesc; zval *z_radh; @@ -251,6 +252,11 @@ return; } + if (timeout == 0) { + zend_error(E_ERROR, "Null timeout not acceptable"); + RETURN_FALSE; + } + ZEND_FETCH_RESOURCE(raddesc, radius_descriptor *, &z_radh, -1, "rad_handle", le_radius); if (rad_add_server(raddesc->radh, hostname, port, secret, timeout, maxtries) == -1) {