regedit: Allow 3 WCHARs of room for the line ending and null terminating characters

Hugh McMaster hugh.mcmaster at outlook.com
Wed Aug 31 03:28:27 CDT 2016


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 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 e3e26c0..fa4f781 100644
--- a/programs/regedit/regproc.c
+++ b/programs/regedit/regproc.c
@@ -772,7 +772,7 @@ static void processRegLinesW(FILE *in)
         /* Do we need to expand the buffer ? */
         assert (s >= buf && s <= buf + lineSize);
         size_remaining = lineSize - (s-buf);
-        if (size_remaining < 2) /* room for 1 character and the \0 */
+        if (size_remaining < 3) /* we need at least 3 WCHARs of room for \r\n\0 */
         {
             WCHAR *new_buffer;
             size_t new_size = lineSize + (REG_VAL_BUF_SIZE / sizeof(WCHAR));
-- 
2.7.4




More information about the wine-patches mailing list