Module: check_mk
Branch: master
Commit: e630bd29e09b8aa660b0f21f8987551226fc2031
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e630bd29e09b8a…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Feb 3 15:45:13 2016 +0100
clang-tidy fixes for clang-analyzer-security.insecureAPI.strcpy check.
---
livestatus/src/module.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/livestatus/src/module.c b/livestatus/src/module.c
index a665caa..c10c6ed 100644
--- a/livestatus/src/module.c
+++ b/livestatus/src/module.c
@@ -647,9 +647,9 @@ void livestatus_parse_arguments(const char *args_orig) {
sizeof(g_logfile_path) - 16 /* len of "livestatus.log" */);
char *slash = strrchr(g_logfile_path, '/');
if (!slash)
- strcpy(g_logfile_path, "/tmp/livestatus.log");
+ strncpy(g_logfile_path, "/tmp/livestatus.log", 20);
else
- strcpy(slash + 1, "livestatus.log");
+ strncpy(slash + 1, "livestatus.log", 15);
/* there is no default PNP path */
g_pnp_path[0] = 0;