re-fix build error about snprintf 63/307663/1
authordyamy-lee <dyamy.lee@samsung.com>
Mon, 11 Mar 2024 07:13:45 +0000 (16:13 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Tue, 12 Mar 2024 06:41:21 +0000 (15:41 +0900)
The variable's length is not proper. So, it changed to reduce size of the variable

Change-Id: I82a2b505ae2f08418a8c552110bdf050e3f7cc8a

common/vc_info_parser.c

index 25e28ce..e0479cb 100644 (file)
@@ -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) {