Always NUL-terminate buffer in note_gc()
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
68cac7345c
commit
574156be7c
@ -187,6 +187,7 @@ void note_gc(void)
|
|||||||
hp = mem_malloc(sizeof(struct note_gc_hash));
|
hp = mem_malloc(sizeof(struct note_gc_hash));
|
||||||
|
|
||||||
strncpy(hp->buf, dp->d_name, MAX_NOTESIZ + 1);
|
strncpy(hp->buf, dp->d_name, MAX_NOTESIZ + 1);
|
||||||
|
hp->buf[MAX_NOTESIZ] = '\0';
|
||||||
hp->hash = hp->buf;
|
hp->hash = hp->buf;
|
||||||
|
|
||||||
HTABLE_INSERT(htp, &gc_htable, hp);
|
HTABLE_INSERT(htp, &gc_htable, hp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user