From f77968f52cf4e04d08683a5f703c84dbaafb2d75 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 13 Oct 2015 14:44:05 -0400 Subject: [PATCH] Fix: initialize getline linesize argument to 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It works by accident because getline() reallocates based on the initial pointer, but doing this falls into a blind spot of the Linux man pages. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- converter/babeltrace-log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c index 210bd091..bdb01f16 100644 --- a/converter/babeltrace-log.c +++ b/converter/babeltrace-log.c @@ -316,7 +316,7 @@ void trace_text(FILE *input, int output) struct ctf_stream_pos pos; ssize_t len; char *line = NULL, *nl; - size_t linesize; + size_t linesize = 0; int ret; memset(&pos, 0, sizeof(pos)); -- 2.34.1