From ee16b381c3b58d01898e03e6c754cef2c7aaf027 Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Sat, 7 Oct 2006 23:53:44 +0000 Subject: [PATCH] * src/input/stream.c: fixed invalid memory access in stream_ReadLine(). --- src/input/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/stream.c b/src/input/stream.c index 09115af62c..3dad4ef47b 100644 --- a/src/input/stream.c +++ b/src/input/stream.c @@ -1551,7 +1551,7 @@ char * stream_ReadLine( stream_t *s ) } /* Remove trailing LF/CR */ - while( i_line > 0 && ( p_line[i_line-2] == '\r' || + while( i_line >= 2 && ( p_line[i_line-2] == '\r' || p_line[i_line-2] == '\n') ) i_line--; /* Make sure the \0 is there */ -- 2.39.2