Fix: initialize getline linesize argument to 0
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 13 Oct 2015 18:44:05 +0000 (14:44 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Fri, 16 Oct 2015 19:40:33 +0000 (15:40 -0400)
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 <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
converter/babeltrace-log.c

index 210bd09152a11b03907300c4c9b807abbad77983..bdb01f16f4b6e7d18f2f642ba3c3c5224072177a 100644 (file)
@@ -316,7 +316,7 @@ void trace_text(FILE *input, int output)
        struct ctf_stream_pos pos;
        ssize_t len;
        char *line = NULL, *nl;
        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));
        int ret;
 
        memset(&pos, 0, sizeof(pos));
This page took 0.024265 seconds and 4 git commands to generate.