projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e5b38fd
)
trace: fix potential use-after-free occurence
author
Nick Hainke
<vincent@systemli.org>
Mon, 30 Aug 2021 20:37:10 +0000
(22:37 +0200)
committer
Daniel Golle
<daniel@makrotopia.org>
Mon, 30 Aug 2021 21:15:10 +0000
(22:15 +0100)
char* tmp is used in the fprintf function altough it is already freed.
Fixes: e5b38fd1 ("trace: free memory allocated by blobmsg_format_json_indent()")
Signed-off-by: Nick Hainke <vincent@systemli.org>
trace/trace.c
patch
|
blob
|
history
diff --git
a/trace/trace.c
b/trace/trace.c
index 87a98a632b5e42eb041357dce417022239006282..40cf3df5b9adc031bd04a34e2beec401728fee00 100644
(file)
--- a/
trace/trace.c
+++ b/
trace/trace.c
@@
-166,8
+166,8
@@
static void print_syscalls(int policy, const char *json)
if (!tmp)
return;
- free(tmp);
fprintf(fp, "%s\n", tmp);
+ free(tmp);
fclose(fp);
ULOG_INFO("saving syscall trace to %s\n", json);
} else {