From ebacf05258bc5f8db39cc13275e254390569b63d Mon Sep 17 00:00:00 2001 From: Jiaxing Wang Date: Thu, 26 Nov 2015 05:22:40 +0100 Subject: [PATCH] regedit: Need 3 bytes of room at end of buffer for \r\n\0 to avoid endless loop. Signed-off-by: Sebastian Lackner Signed-off-by: Alexandre Julliard --- programs/regedit/regproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index 643b559f4f1..2d766de9638 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -641,7 +641,7 @@ static void processRegLinesA(FILE *in, char* first_chars) /* Do we need to expand the buffer ? */ assert (s >= line && s <= line + lineSize); size_remaining = lineSize - (s-line); - if (size_remaining < 2) /* room for 1 character and the \0 */ + if (size_remaining < 3) /* need at least 3 bytes of room for \r\n\0 */ { char *new_buffer; size_t new_size = lineSize + REG_VAL_BUF_SIZE;