mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-10 23:09:18 +00:00
Fix memory corruption in USTAR::SymLink
This commit is contained in:
@ -341,8 +341,9 @@ namespace vfs
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
USTARInode *node = (USTARInode *)Result;
|
||||
strncpy(node->Header->link, Target, sizeof(node->Header->link));
|
||||
USTARInode *node = (USTARInode *)*Result;
|
||||
FileHeader *hdr = node->Header;
|
||||
strncpy(hdr->link, Target, MIN(sizeof(hdr->link) - 1, strlen(Target)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user