Fix potential buffer overruns in sdlayer

git-svn-id: https://svn.eduke32.com/eduke32@7080 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-10-25 23:29:04 +00:00
parent 1f8b23152e
commit 75e141ec81
1 changed files with 2 additions and 2 deletions

View File

@ -808,7 +808,7 @@ int32_t initinput(void)
if (!keytranslation[i])
continue;
Bstrncpyz(g_keyNameTable[keytranslation[i]], SDL_GetKeyName(SDL_SCANCODE_TO_KEYCODE(i)), sizeof(g_keyNameTable[i]));
Bstrncpyz(g_keyNameTable[keytranslation[i]], SDL_GetKeyName(SDL_SCANCODE_TO_KEYCODE(i)), sizeof(g_keyNameTable[0]));
}
if (!SDL_InitSubSystem(SDL_INIT_JOYSTICK))
@ -2098,7 +2098,7 @@ int32_t handleevents_pollsdl(void)
if (OSD_HandleChar(code))
keyBufferInsert(code);
}
} while (j < SDL_TEXTINPUTEVENT_TEXT_SIZE && ev.text.text[++j]);
} while (j < SDL_TEXTINPUTEVENT_TEXT_SIZE-1 && ev.text.text[++j]);
break;
case SDL_KEYDOWN: