- Implemented feature request #33452 (Year belonging to ISO week). (Derick)
- Fixed memory corruption in pg_copy_from() in case the as_null parameter was
passed. (Derick)
+- Fixed crash inside stream_get_line() when length parameter equals 0. (Ilia)
- Fixed bug #33562 (date("") crashes). (Derick)
- Fixed bug #33536 (strtotime() defaults to now even on non time string).
(Derick)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The maximum allowed length must be greater then or equal to zero.");
RETURN_FALSE;
}
+ if (!max_length) {
+ max_length = PHP_SOCK_CHUNK_SIZE;
+ }
php_stream_from_zval(stream, &zstream);
--- /dev/null
+--TEST--
+Crash inside stream_get_line(), when length=0
+--FILE--
+<?php
+$path = dirname(__FILE__) . '/test.html';
+
+file_put_contents($path, "foo<br>bar<br>foo");
+$fp = fopen($path, "r");
+while ($fp && !feof($fp)) {
+ echo stream_get_line($fp, 0, "<br>")."\n";
+}
+fclose($fp);
+@unlink($path);
+?>
+--EXPECT--
+foo
+bar
+foo