aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2018-05-26 12:05:50 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2018-05-26 12:05:50 +0200
commit574156be7c0feae9c66909b2f83a46c6906fdf50 (patch)
treed9f6161174164758b8bcfcb49c762c1ddf1e8c9f /src
parent68cac7345cfe4d90bf6caef8309462572fbd26de (diff)
downloadcalcurse-574156be7c0feae9c66909b2f83a46c6906fdf50.tar.gz
calcurse-574156be7c0feae9c66909b2f83a46c6906fdf50.zip
Always NUL-terminate buffer in note_gc()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src')
-rw-r--r--src/note.c1
1 files changed, 1 insertions, 0 deletions
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);