1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 19:56:25 +00:00

SCP: Avoid potential buffer overruns by using strlcpy() and strlcat()

This commit is contained in:
Mark Pizzolato
2019-03-08 12:31:01 -08:00
parent 72451ba202
commit c7b0928b33
5 changed files with 35 additions and 33 deletions

View File

@@ -1656,9 +1656,9 @@ if (vid_flags & SIM_VID_INPUTCAPTURED) {
char title[150];
memset (title, 0, sizeof(title));
strncpy (title, vid_title, sizeof(title)-1);
strncat (title, " ReleaseKey=", sizeof(title)-(1+strlen(title)));
strncat (title, vid_release_key, sizeof(title)-(1+strlen(title)));
strlcpy (title, vid_title, sizeof(title));
strlcat (title, " ReleaseKey=", sizeof(title));
strlcat (title, vid_release_key, sizeof(title));
#if SDL_MAJOR_VERSION == 1
SDL_WM_SetCaption (title, title);
#else