1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-01-20 20:37:27 +01:00

Fix strncpy usage on linux fs_expand_path

This commit is contained in:
jvazquez-r7 2014-07-07 16:04:59 -05:00
parent a19ce5e6dc
commit 32564013bc

View File

@ -37,7 +37,8 @@ LPSTR fs_expand_path(LPCSTR regular)
char *expandedFilePath;
DWORD expandedFilePathSize = strlen(regular)+1;
expandedFilePath = malloc(expandedFilePathSize);
strncpy(expandedFilePath, regular, expandedFilePathSize - 1);
strncpy(expandedFilePath, regular, expandedFilePathSize);
expandedFilePath[expandedFilePathSize - 1] = '\0';
return expandedFilePath;
#endif
}