regedit: Need 3 bytes of room at end of buffer for \r\n\0 to avoid endless loop.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jiaxing Wang 2015-11-26 05:22:40 +01:00 committed by Alexandre Julliard
parent a1790df348
commit ebacf05258

View file

@ -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;