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:
parent
a19ce5e6dc
commit
32564013bc
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user