Expand array size for null terminate character accepted/tizen/6.5/unified/20211028.102011 accepted/tizen/unified/20210629.130244 submit/tizen/20210628.235744 submit/tizen_6.5/20211028.162201 tizen_6.5.m2_release
authorWoongsuk Cho <ws77.cho@samsung.com>
Mon, 28 Jun 2021 23:05:37 +0000 (08:05 +0900)
committer조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com>
Mon, 28 Jun 2021 23:58:49 +0000 (08:58 +0900)
To avoid svace defect, expand array size.
And copy string include null terminate character

NativeLauncher/launcher/lib/core_runtime.cc

index b500b01..64cee32 100644 (file)
@@ -538,8 +538,8 @@ int CoreRuntime::launch(const char* appId, const char* root, const char* path, i
 
                // set profile.data path and collect/use it if it non-exists/exists.
                if (profile) {
-                       char multiCoreJitProfile[strlen(localDataPath) + strlen(PROFILE_BASENAME)];
-                       strncpy(multiCoreJitProfile, localDataPath, strlen(localDataPath));
+                       char multiCoreJitProfile[strlen(localDataPath) + strlen(PROFILE_BASENAME) + 1];
+                       strncpy(multiCoreJitProfile, localDataPath, strlen(localDataPath) + 1);
                        strncat(multiCoreJitProfile, PROFILE_BASENAME, strlen(PROFILE_BASENAME));
 
                        setEnvironmentVariable("COMPlus_MultiCoreJitProfile", multiCoreJitProfile);