From: Woongsuk Cho Date: Mon, 28 Jun 2021 23:05:37 +0000 (+0900) Subject: Expand array size for null terminate character X-Git-Tag: accepted/tizen/6.5/unified/20211028.102011^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d1949e6d76a4fa7a2f2653953961369133bbeb5;p=platform%2Fcore%2Fdotnet%2Flauncher.git Expand array size for null terminate character To avoid svace defect, expand array size. And copy string include null terminate character --- diff --git a/NativeLauncher/launcher/lib/core_runtime.cc b/NativeLauncher/launcher/lib/core_runtime.cc index b500b01..64cee32 100644 --- a/NativeLauncher/launcher/lib/core_runtime.cc +++ b/NativeLauncher/launcher/lib/core_runtime.cc @@ -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);