Always NUL-terminate buffer in io_load_keys()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
65c2b6d9b8
commit
2cd60c78cf
1
src/io.c
1
src/io.c
@ -1095,6 +1095,7 @@ void io_load_keys(const char *pager)
|
|||||||
while (*p == ' ')
|
while (*p == ' ')
|
||||||
p++;
|
p++;
|
||||||
(void)strncpy(tmpbuf, p, BUFSIZ);
|
(void)strncpy(tmpbuf, p, BUFSIZ);
|
||||||
|
tmpbuf[BUFSIZ - 1] = '\0';
|
||||||
if (sscanf(tmpbuf, "%s", key_ch) == AWAITED) {
|
if (sscanf(tmpbuf, "%s", key_ch) == AWAITED) {
|
||||||
int ch;
|
int ch;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user