From 120f434967f069dace3aeab9a547b62b127d2c04 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 11 Nov 2011 12:12:58 +0100 Subject: src/io.c: Null-terminate the ical_readline() buffer Ensure we always return with a null-terminated buffer, even if we read more than BUFSIZ characters. Signed-off-by: Lukas Fleischer --- src/io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/io.c b/src/io.c index 22f8719..9dcc784 100644 --- a/src/io.c +++ b/src/io.c @@ -1896,6 +1896,7 @@ ical_readline (FILE *fdi, char *buf, char *lstore, unsigned *ln) if (*lstore != SPACE && *lstore != TAB) break; strncat (buf, lstore + 1, BUFSIZ); + buf[BUFSIZ - 1] = '\0'; (*ln)++; } -- cgit v1.2.3-70-g09d2