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]
/
liblttkconsumerd
/
liblttkconsumerd.c
diff --git
a/liblttkconsumerd/liblttkconsumerd.c
b/liblttkconsumerd/liblttkconsumerd.c
index a135570fd5c2fe1efebd3c69d443e75e25e949ba..9ad380c8dab5e8c1be679a0881890e929f355c57 100644
(file)
--- a/
liblttkconsumerd/liblttkconsumerd.c
+++ b/
liblttkconsumerd/liblttkconsumerd.c
@@
-177,6
+177,7
@@
static int kconsumerd_add_fd(struct lttcomm_kconsumerd_msg *buf, int consumerd_f
tmp_fd->state = buf->state;
tmp_fd->max_sb_size = buf->max_sb_size;
strncpy(tmp_fd->path_name, buf->path_name, PATH_MAX);
+ tmp_fd->path_name[PATH_MAX - 1] = '\0';
/* Opening the tracefile in write mode */
ret = open(tmp_fd->path_name,
This page took
0.025715 seconds
and
5
git commands to generate.