From 0c3e587feb13330de4ac28c6fda6c9017e9c4b46 Mon Sep 17 00:00:00 2001 From: dyamy-lee Date: Mon, 11 Mar 2024 16:13:45 +0900 Subject: [PATCH] re-fix build error about snprintf The variable's length is not proper. So, it changed to reduce size of the variable Change-Id: I82a2b505ae2f08418a8c552110bdf050e3f7cc8a --- common/vc_info_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/vc_info_parser.c b/common/vc_info_parser.c index 25e28ce..e0479cb 100644 --- a/common/vc_info_parser.c +++ b/common/vc_info_parser.c @@ -375,9 +375,9 @@ static int __is_symbolic_link(const char* path, bool* is_symbolic) SLOG(LOG_DEBUG, vc_info_tag(), "[DEBUG] %s is real file, not symbolic link", path); *is_symbolic = false; } else { - char current_working_directory[PATH_MAX]; + char current_working_directory[PATH_MAX/2]; char temp_path[PATH_MAX]; - if (getcwd(current_working_directory, PATH_MAX)) { + if (getcwd(current_working_directory, PATH_MAX/2)) { if (strlen(current_working_directory) + strlen(path) <= PATH_MAX) { snprintf(temp_path, PATH_MAX, "%s/%s", current_working_directory, path); if (strncmp(temp_path, real_path, strlen(temp_path) + 1) == 0) { -- 2.34.1