History log of /PHP-7.4/ext/spl/tests/bug80933.phpt (Results 1 – 1 of 1)
Revision Date Author Comments
# 976e71a2 13-Apr-2021 Christoph M. Becker

Fix #80933: SplFileObject::DROP_NEW_LINE is broken for NUL and CR

`buf` may contain NUL bytes, so we must not use `strcspn()` but rather
a binary safe variant. However, we also must not

Fix #80933: SplFileObject::DROP_NEW_LINE is broken for NUL and CR

`buf` may contain NUL bytes, so we must not use `strcspn()` but rather
a binary safe variant. However, we also must not detect a stray CR as
line ending, and since we only need to check line endings at the end
of the buffer, we can nicely optimize.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-6836.

show more ...