From 2f5f37585043d7cb5baf90c65f4923c455887e5d Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 5 Dec 2006 13:45:49 +0000 Subject: [PATCH] don't pass negative maxchars to php_stream_get_line_ex() --- ext/standard/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/file.c b/ext/standard/file.c index c035722609..83c26994e8 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -2153,7 +2153,7 @@ PHP_FUNCTION(fgetcsv) } } - buf.v = php_stream_get_line_ex(stream, stream->readbuf_type, NULL_ZSTR, 0, len, &buf_len); + buf.v = php_stream_get_line_ex(stream, stream->readbuf_type, NULL_ZSTR, 0, (len < 0) ? 0 : len, &buf_len); if (!buf.v) { /* No data */ RETVAL_FALSE; -- 2.40.0