win32gui buffer overrun (from <Someone>)

splash screen off by one error overwrote one byte outside the
mallocked block
This commit is contained in:
nethack.allison
2003-07-31 11:04:17 +00:00
parent c954ee8a10
commit a4a5e8d8dd

View File

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