From: Arnaud Le Blanc Date: Fri, 8 May 2009 09:44:17 +0000 (+0000) Subject: Fix invalid read X-Git-Tag: php-5.3.0RC3~319 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d13e22f4194ba8cc60ec995a359da4032044b65;p=php Fix invalid read --- diff --git a/ext/standard/file.c b/ext/standard/file.c index ae4fcb1f4a..d83f911805 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -785,7 +785,7 @@ parse_eol: } else { do { int windows_eol = 0; - if (eol_marker == '\n' && *(p - 1) == '\r') { + if (p != target_buf && eol_marker == '\n' && *(p - 1) == '\r') { windows_eol++; } if (skip_blank_lines && !(p-s-windows_eol)) {