mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-27 23:14:38 +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)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
USTARInode *node = (USTARInode *)Result;
|
USTARInode *node = (USTARInode *)*Result;
|
||||||
strncpy(node->Header->link, Target, sizeof(node->Header->link));
|
FileHeader *hdr = node->Header;
|
||||||
|
strncpy(hdr->link, Target, MIN(sizeof(hdr->link) - 1, strlen(Target)));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user