mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-25 22:14:37 +00:00
Fix memory corruption in USTAR::SymLink
This commit is contained in:
parent
51ea074b60
commit
4d201a5264
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user