To avoid svace defect, expand array size.
And copy string include null terminate character
// 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);