* [PATCH] libtracefs: Initialized func_list in tracefs_filter_functions()
@ 2022-01-26 2:53 Steven Rostedt
0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2022-01-26 2:53 UTC (permalink / raw)
To: Linux Trace Devel
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
The variable func_list is used to create a link list and it is expected to
be NULL. This causes a crash because of the logic checks it before it gets
initialized.
Initialize func_list to NULL.
This was found by valgrind after a crash.
Fixes: c1606fb72264a ("libtracefs: Implement tracefs_filter_functions()")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
src/tracefs-tools.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tracefs-tools.c b/src/tracefs-tools.c
index ae85444b67dd..489be28a3b94 100644
--- a/src/tracefs-tools.c
+++ b/src/tracefs-tools.c
@@ -1237,7 +1237,7 @@ void tracefs_trace_pipe_stop(struct tracefs_instance *instance)
int tracefs_filter_functions(const char *filter, const char *module, char ***list)
{
struct func_filter func_filter;
- struct func_list *func_list, *f;
+ struct func_list *func_list = NULL, *f;
char **funcs = NULL;
int ret;
--
2.33.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-26 2:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 2:53 [PATCH] libtracefs: Initialized func_list in tracefs_filter_functions() 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.