iliaa Thu Jan 1 19:57:24 2004 EDT Modified files: /php-src/ext/standard file.c Log: Fixed bug #26752 (Silent unterminated loop when length parameter for fgets(), fread() and fgetss() is 0). Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.371 php-src/ext/standard/file.c:1.372 --- php-src/ext/standard/file.c:1.371 Wed Dec 24 16:30:43 2003 +++ php-src/ext/standard/file.c Thu Jan 1 19:57:23 2004 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.371 2003/12/24 21:30:43 moriyoshi Exp $ */ +/* $Id: file.c,v 1.372 2004/01/02 00:57:23 iliaa Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -919,8 +919,8 @@ convert_to_long_ex(arg2); len = Z_LVAL_PP(arg2); - if (len < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not be negative"); + if (len <= 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater then 0."); RETURN_FALSE; } @@ -1026,8 +1026,8 @@ if (bytes != NULL) { convert_to_long_ex(bytes); - if (Z_LVAL_PP(bytes) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not be negative"); + if (Z_LVAL_PP(bytes) <= 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater then 0."); RETURN_FALSE; } @@ -1640,8 +1640,8 @@ convert_to_long_ex(arg2); len = Z_LVAL_PP(arg2); - if (len < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not be negative"); + if (len <= 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater then 0."); RETURN_FALSE; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php