Always NUL-terminate buffer in io_load_keys()

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer 2018-05-26 11:52:41 +02:00
parent 65c2b6d9b8
commit 2cd60c78cf

View File

@ -1095,6 +1095,7 @@ void io_load_keys(const char *pager)
while (*p == ' ')
p++;
(void)strncpy(tmpbuf, p, BUFSIZ);
tmpbuf[BUFSIZ - 1] = '\0';
if (sscanf(tmpbuf, "%s", key_ch) == AWAITED) {
int ch;