mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
/W4: Fix potentially non zero-terminated string
The prior call to 'strcpy' might not zero-terminated string, explicitly perform this operation to prevent this bug.
This commit is contained in:
parent
e1f0e72af4
commit
a71839f13a
@ -611,6 +611,7 @@ V_MakeAbsolutePath(char* pOut, size_t outLen, const char* pPath, const char* pSt
|
||||
{
|
||||
// pPath is not relative.. just copy it.
|
||||
V_strncpy(pOut, pPath, outLen);
|
||||
pOut[outLen - 1] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -618,6 +619,7 @@ V_MakeAbsolutePath(char* pOut, size_t outLen, const char* pPath, const char* pSt
|
||||
if (pStartingDir && V_IsAbsolutePath(pStartingDir))
|
||||
{
|
||||
V_strncpy(pOut, pStartingDir, outLen);
|
||||
pOut[outLen - 1] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user