projects
/
deliverable
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix all strncpy() usage: need to set a final \0 character at the end
[deliverable/lttng-tools.git]
/
ltt-sessiond
/
ust-ctl.c
diff --git
a/ltt-sessiond/ust-ctl.c
b/ltt-sessiond/ust-ctl.c
index abee38817135392c93b55fb97a78d54936f0545a..d9d4af51a1dc16751bdfd5e26c5412280307526e 100644
(file)
--- a/
ltt-sessiond/ust-ctl.c
+++ b/
ltt-sessiond/ust-ctl.c
@@
-89,7
+89,8
@@
void get_traces_per_session(struct ltt_session *session, struct lttng_trace *tra
if (session->kern_session_count > 0) {
trace.type = KERNEL;
- strncpy(trace.name, "kernel", 6);
+ strncpy(trace.name, "kernel", sizeof(trace.name));
+ trace.name[sizeof(trace.name) - 1] = '\0';
memcpy(&traces[i], &trace, sizeof(trace));
}
}
This page took
0.024589 seconds
and
5
git commands to generate.