diff options
author | Lukas Fleischer <lfleischer@calcurse.org> | 2018-05-26 11:52:41 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2018-05-26 11:52:41 +0200 |
commit | 2cd60c78cf8411a0d1592da458e2832e7b1b20db (patch) | |
tree | 28008f1d0672d065ba1466593f075293a922adda | |
parent | 65c2b6d9b82bad15a63312eef96917d9c450baf8 (diff) | |
download | calcurse-2cd60c78cf8411a0d1592da458e2832e7b1b20db.tar.gz calcurse-2cd60c78cf8411a0d1592da458e2832e7b1b20db.zip |
Always NUL-terminate buffer in io_load_keys()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r-- | src/io.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; |