diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-07-08 13:24:25 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-07-08 13:24:25 +0200 |
commit | a32f6b008aafedd289a79947d08d304e9aaad57a (patch) | |
tree | eb4a67a8bbdcff7d8e03e1fe2c551667c94c00ac /src/note.c | |
parent | 936d5f139f0450ab1d6af96b5d91a776483e0455 (diff) | |
download | calcurse-a32f6b008aafedd289a79947d08d304e9aaad57a.zip |
Make sure that tmppath is always NULL-terminated
Fixes GitHub issue #5.
Reported-by: dcb314
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/note.c')
-rw-r--r-- | src/note.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; |