From: Wez Furlong Date: Wed, 14 Jan 2004 14:31:27 +0000 (+0000) Subject: Fixed bug #26772 (fgets returns NULL instead of FALSE). (Wez) X-Git-Tag: php-4.3.5RC2~82 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70e26f8ebca8f22c5bba75c868efcd1bf4713c46;p=php Fixed bug #26772 (fgets returns NULL instead of FALSE). (Wez) --- diff --git a/NEWS b/NEWS index 7fde876809..dc2b86db4c 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ PHP 4 NEWS - Fixed bug #26878 (problem with multiple references to the same variable with different types). (Ilia) - Fixed bug #26896 (ext/ftp does not work as shared extension). (Jani) +- Fixed bug #26772 (fgets returns NULL instead of FALSE). (Wez) 12 Jan 2004, Version 4.3.5RC1 - Synchronized bundled GD library with GD 2.0.17 diff --git a/ext/standard/file.c b/ext/standard/file.c index e8b3f8d4a8..25db8f3435 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1363,7 +1363,11 @@ PHPAPI PHP_FUNCTION(fgets) WRONG_PARAM_COUNT; } - php_stream_from_zval(stream, arg1); + php_stream_from_zval_no_verify(stream, arg1); + if (stream == NULL) { + /* want a false return value here */ + goto exit_failed; + } if (argc == 1) { /* ask streams to give us a buffer of an appropriate size */