From 2fd047a105f5cb211dcbc23bd5d8d37f941395e7 Mon Sep 17 00:00:00 2001 From: "sanghyeok.oh" Date: Fri, 9 Sep 2016 16:34:17 +0900 Subject: [PATCH] svace:change strcat to strncat Change-Id: I546599c8f5c850eda6374a792492e7db1e9dcf7a Signed-off-by: sanghyeok.oh --- src/internal/policy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal/policy.cpp b/src/internal/policy.cpp index bed844a..5251fd2 100644 --- a/src/internal/policy.cpp +++ b/src/internal/policy.cpp @@ -462,8 +462,8 @@ const char* MatchItemSR::toString(char* str) const { char tmp[MAX_LOG_LINE]; tmp[0] = 0; for (int i = 0; i < names_num; i++) { - std::strcat(tmp, names[i].name); - std::strcat(tmp, " "); + std::strncat(tmp, names[i].name, sizeof(tmp) - strlen(tmp) - 1); + std::strncat(tmp, " ", sizeof(tmp) - strlen(tmp) - 1); } snprintf(str, MAX_LOG_LINE, "matcher: services(%s), interface(%s), member(%s), path(%s), type(%s), direction(%s)", tmp, interface, member, path, __message_type_to_str(type), __message_dir_to_str(direction) ); return str; -- 2.7.4