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
+2 -2
View File
@@ -109,7 +109,7 @@ void mswin_display_splash_window (BOOL show_ver)
line[len + 1] = '\0'; line[len + 1] = '\0';
len++; len++;
} }
if (strsize + (int)len > bufsize) if (strsize + (int)len + 1 > bufsize)
{ {
bufsize += BUFSZ; bufsize += BUFSZ;
buf = realloc(buf, bufsize); buf = realloc(buf, bufsize);
@@ -140,7 +140,7 @@ void mswin_display_splash_window (BOOL show_ver)
line[len + 1] = '\0'; line[len + 1] = '\0';
len++; len++;
} }
if (strsize + (int)len > bufsize) if (strsize + (int)len + 1 > bufsize)
{ {
bufsize += BUFSZ; bufsize += BUFSZ;
buf = realloc(buf, bufsize); buf = realloc(buf, bufsize);