1
0
Fork 0
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:
Jonas 'Sortie' Termansen 2015-07-09 18:27:06 +02:00
parent 7953023517
commit c88dadae8b

View file

@ -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); ssize_t amount = inode->ReadAt((uint8_t*) buf, bufsize, 0);
if ( amount < 0 ) if ( amount < 0 )
return inode->Unref(), -errno; 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(); inode->Unref();
return 0; return 0;
} }