* [PATCH] trace-cmd: avoid using uninitialized handle
@ 2019-06-27 15:27 Greg Thelen
2019-06-27 15:41 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Greg Thelen @ 2019-06-27 15:27 UTC (permalink / raw)
To: Steven Rostedt; +Cc: linux-trace-devel, Greg Thelen
The put_together_file() 'out' error path uses uninitialized handle.
Unconditionally initialize handle.
Fixes: 9ed499fccef5 ("trace-cmd: Fix record --date flag when sending tracing data to a listener")
Signed-off-by: Greg Thelen <gthelen@google.com>
---
tracecmd/trace-listen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tracecmd/trace-listen.c b/tracecmd/trace-listen.c
index 3106022eeb39..9132582768ac 100644
--- a/tracecmd/trace-listen.c
+++ b/tracecmd/trace-listen.c
@@ -626,7 +626,7 @@ static void stop_all_readers(int cpus, int *pid_array)
static int put_together_file(int cpus, int ofd, const char *node,
const char *port, bool write_options)
{
- struct tracecmd_output *handle;
+ struct tracecmd_output *handle = NULL;
char **temp_files;
int cpu;
int ret = -ENOMEM;
--
2.22.0.410.gd8fdbe21b5-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] trace-cmd: avoid using uninitialized handle
2019-06-27 15:27 [PATCH] trace-cmd: avoid using uninitialized handle Greg Thelen
@ 2019-06-27 15:41 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2019-06-27 15:41 UTC (permalink / raw)
To: Greg Thelen; +Cc: linux-trace-devel
On Thu, 27 Jun 2019 08:27:10 -0700
Greg Thelen <gthelen@google.com> wrote:
> The put_together_file() 'out' error path uses uninitialized handle.
> Unconditionally initialize handle.
Yep, that's true.
>
> Fixes: 9ed499fccef5 ("trace-cmd: Fix record --date flag when sending tracing data to a listener")
Thanks, I'll add this to the queue.
-- Steve
> Signed-off-by: Greg Thelen <gthelen@google.com>
> ---
> tracecmd/trace-listen.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tracecmd/trace-listen.c b/tracecmd/trace-listen.c
> index 3106022eeb39..9132582768ac 100644
> --- a/tracecmd/trace-listen.c
> +++ b/tracecmd/trace-listen.c
> @@ -626,7 +626,7 @@ static void stop_all_readers(int cpus, int *pid_array)
> static int put_together_file(int cpus, int ofd, const char *node,
> const char *port, bool write_options)
> {
> - struct tracecmd_output *handle;
> + struct tracecmd_output *handle = NULL;
> char **temp_files;
> int cpu;
> int ret = -ENOMEM;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-27 15:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27 15:27 [PATCH] trace-cmd: avoid using uninitialized handle Greg Thelen
2019-06-27 15:41 ` Steven Rostedt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.