From 1d13e22f4194ba8cc60ec995a359da4032044b65 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Fri, 8 May 2009 09:44:17 +0000 Subject: [PATCH] Fix invalid read --- ext/standard/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) { -- 2.50.1