aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2018-05-26 12:05:41 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2018-05-26 12:05:41 +0200
commit68cac7345cfe4d90bf6caef8309462572fbd26de (patch)
treead571a1788df2ee445b66607de18acca3a2bba4c
parent7efe03cf0552234852be6e4537c5fe0ce0c6841c (diff)
downloadcalcurse-68cac7345cfe4d90bf6caef8309462572fbd26de.tar.gz
calcurse-68cac7345cfe4d90bf6caef8309462572fbd26de.zip
Always NUL-terminate buffer in keys_fill_missing()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r--src/keys.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/keys.c b/src/keys.c
index 578c973..a06858d 100644
--- a/src/keys.c
+++ b/src/keys.c
@@ -720,6 +720,7 @@ void keys_fill_missing(void)
char *p, tmpbuf[BUFSIZ];
strncpy(tmpbuf, keydef[i].binding, BUFSIZ);
+ tmpbuf[BUFSIZ - 1] = '\0';
p = tmpbuf;
for (;;) {
char key_ch[BUFSIZ];