Add extra checks in for file handle lookup

This commit is contained in:
Antonio SJ Musumeci 2026-02-26 21:19:39 -06:00
parent 184464f60a
commit 170c1cbfa0
3 changed files with 7 additions and 0 deletions

View file

@ -18,6 +18,7 @@
#pragma once
#include "assert.hpp"
#include "fh.hpp"
#include "base_types.h"

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_);

View file

@ -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_);