summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2004-01-14 14:25:01 +0000
committerWez Furlong <wez@php.net>2004-01-14 14:25:01 +0000
commitcd4262eedd9da3c6b1d4292075842902b36704ea (patch)
tree9d49ebec19a380832577a4d98232a35d426923c9
parent59d168eda7c1d63ecb063af8a3f70b49c000a181 (diff)
downloadphp-git-cd4262eedd9da3c6b1d4292075842902b36704ea.tar.gz
Fix #26772: fgets returns NULL instead of FALSE.
-rw-r--r--ext/standard/file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 21a10cb3f0..79abc8aa1e 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -907,7 +907,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) {
+ /* we want false return value, rather than NULL */
+ goto exit_failed;
+ }
if (argc == 1) {
/* ask streams to give us a buffer of an appropriate size */