From 574156be7c0feae9c66909b2f83a46c6906fdf50 Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <lfleischer@calcurse.org>
Date: Sat, 26 May 2018 12:05:50 +0200
Subject: Always NUL-terminate buffer in note_gc()

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
---
 src/note.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src')

diff --git a/src/note.c b/src/note.c
index dd9d974..8d5d09a 100644
--- a/src/note.c
+++ b/src/note.c
@@ -187,6 +187,7 @@ void note_gc(void)
 			hp = mem_malloc(sizeof(struct note_gc_hash));
 
 			strncpy(hp->buf, dp->d_name, MAX_NOTESIZ + 1);
+			hp->buf[MAX_NOTESIZ] = '\0';
 			hp->hash = hp->buf;
 
 			HTABLE_INSERT(htp, &gc_htable, hp);
-- 
cgit v1.2.3-70-g09d2