projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: illegal memory access in write_pidfile
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
main.c
diff --git
a/src/bin/lttng-sessiond/main.c
b/src/bin/lttng-sessiond/main.c
index d94dbd7908fb33b35fea1ba9349c2c56d8c43c2e..6081fb2b026818b43c60302d1e9d60a316336300 100644
(file)
--- a/
src/bin/lttng-sessiond/main.c
+++ b/
src/bin/lttng-sessiond/main.c
@@
-5443,7
+5443,10
@@
static int write_pidfile(void)
assert(rundir);
if (opt_pidfile) {
assert(rundir);
if (opt_pidfile) {
- strncpy(pidfile_path, opt_pidfile, sizeof(pidfile_path));
+ if (lttng_strncpy(pidfile_path, opt_pidfile, sizeof(pidfile_path))) {
+ ret = -1;
+ goto error;
+ }
} else {
/* Build pidfile path from rundir and opt_pidfile. */
ret = snprintf(pidfile_path, sizeof(pidfile_path), "%s/"
} else {
/* Build pidfile path from rundir and opt_pidfile. */
ret = snprintf(pidfile_path, sizeof(pidfile_path), "%s/"
This page took
0.024135 seconds
and
4
git commands to generate.