]> granicus.if.org Git - php/commitdiff
don't pass negative maxchars to php_stream_get_line_ex()
authorAntony Dovgal <tony2001@php.net>
Tue, 5 Dec 2006 13:45:49 +0000 (13:45 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 5 Dec 2006 13:45:49 +0000 (13:45 +0000)
ext/standard/file.c

index c035722609c534e3dd2d0f9dcaf14c016a818e2a..83c26994e89732a15b39a8c3c8b9d50ed750a732 100644 (file)
@@ -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;