Add extra checks in for file handle lookup

This commit is contained in:
Antonio SJ Musumeci 2026-02-26 21:19:39 -06:00 • committed by trapexit
parent 099ce2d91d
commit 1d1bcd3b87
3 changed files with 7 additions and 0 deletions

View file

@ -55,6 +55,9 @@ FUSE::ftruncate(const fuse_req_ctx_t *ctx_,
});
}
if(fh == 0)
return -ENOENT;
FileInfo *fi = FileInfo::from_fh(fh);
return ::_ftruncate(fi->fd,size_);