diff --git a/src/dirinfo.hpp b/src/dirinfo.hpp index 8ae2315c..b48e7414 100644 --- a/src/dirinfo.hpp +++ b/src/dirinfo.hpp @@ -18,6 +18,7 @@ #pragma once +#include "assert.hpp" #include "fh.hpp" #include "base_types.h" diff --git a/src/fuse_ftruncate.cpp b/src/fuse_ftruncate.cpp index 46e02b73..677656fc 100644 --- a/src/fuse_ftruncate.cpp +++ b/src/fuse_ftruncate.cpp @@ -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_); diff --git a/src/fuse_futimens.cpp b/src/fuse_futimens.cpp index 9c94c231..40387dd6 100644 --- a/src/fuse_futimens.cpp +++ b/src/fuse_futimens.cpp @@ -57,6 +57,9 @@ FUSE::futimens(const fuse_req_ctx_t *ctx_, }); } + if(fh == 0) + return -ENOENT; + FileInfo *fi = FileInfo::from_fh(fh); return ::_futimens(fi->fd,ts_);