From a32f6b008aafedd289a79947d08d304e9aaad57a Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 8 Jul 2014 13:24:25 +0200 Subject: Make sure that tmppath is always NULL-terminated Fixes GitHub issue #5. Reported-by: dcb314 Signed-off-by: Lukas Fleischer --- src/note.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/note.c') diff --git a/src/note.c b/src/note.c index a6e48d7..9bce762 100644 --- a/src/note.c +++ b/src/note.c @@ -83,6 +83,7 @@ void edit_note(char **note, const char *editor) FILE *fp; strncpy(tmppath, get_tempdir(), BUFSIZ); + tmppath[BUFSIZ - 1] = '\0'; strncat(tmppath, "/calcurse-note.", BUFSIZ - strlen(tmppath) - 1); if ((tmpext = new_tempfile(tmppath, TMPEXTSIZ)) == NULL) return; -- cgit v1.2.3-54-g00ecf