git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
eal/windows: add missing SPDX license tag
[dpdk.git]
/
lib
/
librte_eal
/
common
/
eal_common_trace_ctf.c
diff --git
a/lib/librte_eal/common/eal_common_trace_ctf.c
b/lib/librte_eal/common/eal_common_trace_ctf.c
index
174cdac
..
33e419a
100644
(file)
--- a/
lib/librte_eal/common/eal_common_trace_ctf.c
+++ b/
lib/librte_eal/common/eal_common_trace_ctf.c
@@
-37,11
+37,12
@@
meta_copy(char **meta, int *offset, char *str, int rc)
if (rc < 0)
return rc;
if (rc < 0)
return rc;
- ptr = realloc(ptr, count + rc);
+ ptr = realloc(ptr, count + rc
+ 1
);
if (ptr == NULL)
goto free_str;
memcpy(RTE_PTR_ADD(ptr, count), str, rc);
if (ptr == NULL)
goto free_str;
memcpy(RTE_PTR_ADD(ptr, count), str, rc);
+ ptr[count + rc] = '\0';
count += rc;
free(str);
count += rc;
free(str);
@@
-231,9
+232,10
@@
meta_event_emit(char **meta, int *offset, struct trace_point *tp)
" id = %d;\n"
" name = \"%s\";\n"
" fields := struct {\n"
" id = %d;\n"
" name = \"%s\";\n"
" fields := struct {\n"
- "
%s\n
"
+ "
%s
"
" };\n"
" };\n"
- "};\n\n", trace_id_get(tp->handle), tp->name, tp->ctf_field);
+ "};\n\n", trace_id_get(tp->handle), tp->name,
+ tp->ctf_field != NULL ? tp->ctf_field : "");
return meta_copy(meta, offset, str, rc);
}
return meta_copy(meta, offset, str, rc);
}