change temp_path's length 19/308219/1
authordyamy-lee <dyamy.lee@samsung.com>
Tue, 19 Mar 2024 10:36:01 +0000 (19:36 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Wed, 20 Mar 2024 02:10:15 +0000 (11:10 +0900)
Change the temp_path's length as PATH_MAX*2.
Previous version is reduced current_working_directory size as half of PATH_MAX,
but ses build gives still fail.
So, it changed increasing temp_path's length

Change-Id: If957d04dd819267c4b9c0753809e3d2dde7d7e29

common/vc_info_parser.c

index d6ba008..3eb3081 100644 (file)
@@ -375,11 +375,11 @@ 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/2];
-                       char temp_path[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);
+                       char current_working_directory[PATH_MAX];
+                       char temp_path[PATH_MAX*2];
+                       if (getcwd(current_working_directory, PATH_MAX)) {
+                               if (strlen(current_working_directory) + strlen(path) <= PATH_MAX*2) {
+                                       snprintf(temp_path, PATH_MAX*2, "%s/%s", current_working_directory, path);
                                        if (strncmp(temp_path, real_path, strlen(temp_path) + 1) == 0) {
                                                SLOG(LOG_DEBUG, vc_info_tag(), "[DEBUG] %s is real file, not symbolic link", path);
                                                *is_symbolic = false;