From: nethack.allison Date: Thu, 31 Jul 2003 11:04:17 +0000 (+0000) Subject: win32gui buffer overrun (from ) X-Git-Tag: MOVE2GIT~1874 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4a5e8d8ddcc4531fb16142fe36a01ad2dcb9a96;p=nethack win32gui buffer overrun (from ) splash screen off by one error overwrote one byte outside the mallocked block --- diff --git a/win/win32/mhsplash.c b/win/win32/mhsplash.c index ecc4661a3..c417b6fef 100644 --- a/win/win32/mhsplash.c +++ b/win/win32/mhsplash.c @@ -109,7 +109,7 @@ void mswin_display_splash_window (BOOL show_ver) line[len + 1] = '\0'; len++; } - if (strsize + (int)len > bufsize) + if (strsize + (int)len + 1 > bufsize) { bufsize += BUFSZ; buf = realloc(buf, bufsize); @@ -140,7 +140,7 @@ void mswin_display_splash_window (BOOL show_ver) line[len + 1] = '\0'; len++; } - if (strsize + (int)len > bufsize) + if (strsize + (int)len + 1 > bufsize) { bufsize += BUFSZ; buf = realloc(buf, bufsize);