diff options
-rw-r--r-- | ext/standard/file.c | 6 |
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 */ |