mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix extfs fuse readlink buffer overrun.
This commit is contained in:
parent
7953023517
commit
c88dadae8b
1 changed files with 1 additions and 1 deletions
|
@ -168,7 +168,7 @@ int ext2_fuse_readlink(const char* path, char* buf, size_t bufsize)
|
|||
ssize_t amount = inode->ReadAt((uint8_t*) buf, bufsize, 0);
|
||||
if ( amount < 0 )
|
||||
return inode->Unref(), -errno;
|
||||
buf[(size_t) amount < bufsize ? (size_t) bufsize : bufsize - 1] = '\0';
|
||||
buf[(size_t) amount < bufsize ? (size_t) amount : bufsize - 1] = '\0';
|
||||
inode->Unref();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue