mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-25 18:40:18 -04:00
Add null pointer checks for FileInfo/DirInfo
This commit is contained in:
parent
1220befacf
commit
80aead7085
4 changed files with 14 additions and 0 deletions
|
|
@ -60,6 +60,11 @@ FUSE::copy_file_range(const fuse_req_ctx_t *ctx_,
|
|||
FileInfo *src_fi = FileInfo::from_fh(src_ffi_->fh);
|
||||
FileInfo *dst_fi = FileInfo::from_fh(dst_ffi_->fh);
|
||||
|
||||
if(not src_fi)
|
||||
return -EBADF;
|
||||
if(not dst_fi)
|
||||
return -EBADF;
|
||||
|
||||
return ::_copy_file_range(src_fi->fd,
|
||||
src_off_,
|
||||
dst_fi->fd,
|
||||
|
|
|
|||
|
|
@ -45,5 +45,8 @@ FUSE::flush(const fuse_req_ctx_t *ctx_,
|
|||
{
|
||||
FileInfo *fi = FileInfo::from_fh(ffi_->fh);
|
||||
|
||||
if(not fi)
|
||||
return -EBADF;
|
||||
|
||||
return ::_flush(fi->fd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,5 +51,8 @@ FUSE::fsync(const fuse_req_ctx_t *ctx_,
|
|||
{
|
||||
FileInfo *fi = FileInfo::from_fh(fh_);
|
||||
|
||||
if(not fi)
|
||||
return -EBADF;
|
||||
|
||||
return ::_fsync(fi->fd,isdatasync_);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,5 +43,8 @@ FUSE::fsyncdir(const fuse_req_ctx_t *ctx_,
|
|||
{
|
||||
DirInfo *di = DirInfo::from_fh(ffi_->fh);
|
||||
|
||||
if(not di)
|
||||
return -EBADF;
|
||||
|
||||
return ::_fsyncdir(di,isdatasync_);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue