From: Ilia Alshanetsky Date: Mon, 10 Dec 2007 14:18:02 +0000 (+0000) Subject: MFB: Fixed bug #43522 (stream_get_line() eats additional characters) X-Git-Tag: php-5.2.6RC1~258 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a9ad0081d3ab49223cba88994d8c5c212cd07bf;p=php MFB: Fixed bug #43522 (stream_get_line() eats additional characters) --- diff --git a/NEWS b/NEWS index aec5190051..00cf11231a 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ PHP NEWS - Fixed weired behavior in CGI parameter parsing. (Dmitry, Hannes Magnusson) - Fixed bug #43533 (escapeshellarg('') returns null). (Ilia) +- Fixed bug #43522 (stream_get_line() eats additional characters). (Felipe, + Ilia) - Fixed bug #43495 (array_merge_recursive() crashes with recursive arrays). (Ilia) - Fixed bug #43493 (pdo_pgsql does not send username on connect when password diff --git a/ext/standard/tests/file/bug43522.phpt b/ext/standard/tests/file/bug43522.phpt new file mode 100644 index 0000000000..10e44fc352 --- /dev/null +++ b/ext/standard/tests/file/bug43522.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #43522 (stream_get_line() eats additional characters) +--FILE-- + +--EXPECT-- +Delimiter: ZZZ + readbuf + stream->readpos, *delim, stream->writepos - stream->readpos); + e = memchr(stream->readbuf + stream->readpos, *delim, maxlen); } else { - e = php_memnstr(stream->readbuf + stream->readpos, delim, delim_len, (stream->readbuf + stream->writepos)); + e = php_memnstr(stream->readbuf + stream->readpos, delim, delim_len, (stream->readbuf + stream->readpos + maxlen)); } if (!e) {