aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2018-05-26 11:52:41 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2018-05-26 11:52:41 +0200
commit2cd60c78cf8411a0d1592da458e2832e7b1b20db (patch)
tree28008f1d0672d065ba1466593f075293a922adda
parent65c2b6d9b82bad15a63312eef96917d9c450baf8 (diff)
downloadcalcurse-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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/io.c b/src/io.c
index d358263..1494d94 100644
--- a/src/io.c
+++ b/src/io.c
@@ -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;