Fix terminators on NFReleaseInfo strings
@@ -68,20 +68,23 @@ __nfweak void NFReleaseInfo::Init(
// fill each one, if it was provided
if (NULL != info)
{
- len = MIN(infoLen, sizeof(NFReleaseInfo.InfoString));
+ len = MIN(infoLen, sizeof(NFReleaseInfo.InfoString) - 1);
memcpy(NFReleaseInfo.InfoString, info, len);
+ NFReleaseInfo.InfoString[len] = 0;
}
if (NULL != target)
{
- len = MIN(targetLen, sizeof(NFReleaseInfo.TargetName));
+ len = MIN(targetLen, sizeof(NFReleaseInfo.TargetName) - 1);
memcpy(NFReleaseInfo.TargetName, target, len);
+ NFReleaseInfo.TargetName[len] = 0;
}
if (NULL != platform)
{
- len = MIN(platformLen, sizeof(NFReleaseInfo.PlatformName));
+ len = MIN(platformLen, sizeof(NFReleaseInfo.PlatformName) - 1);
memcpy(NFReleaseInfo.PlatformName, platform, len);
+ NFReleaseInfo.PlatformName[len] = 0;
}
}
