From 2cd60c78cf8411a0d1592da458e2832e7b1b20db Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 26 May 2018 11:52:41 +0200 Subject: Always NUL-terminate buffer in io_load_keys() Signed-off-by: Lukas Fleischer --- src/io.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2