aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorwinndows <winndows@163.com>2020-07-11 02:58:07 +0800
committerGitHub <noreply@github.com>2020-07-10 19:58:07 +0100
commit9e1c2a4959c16c0b50090dd822389ad9acb08111 (patch)
tree0e4ced850caa2e3a18bfb01892ebcbf4af1db0fa /lib
parent7471156354002c6547aa6c3a4f39a3262f435ba4 (diff)
downloadlibfuse-9e1c2a4959c16c0b50090dd822389ad9acb08111.tar.gz
fuse_lowlevel: Move assert for se before dereferencing it with se->debug (#530)
Move assert for se before dereferencing it with se->debug. Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn> Co-authored-by: Liao Pingfang <liao.pingfang@zte.com.cn>
Diffstat (limited to 'lib')
-rw-r--r--lib/fuse_lowlevel.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index 3dabbd5..7b72ee0 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -167,6 +167,7 @@ static int fuse_send_msg(struct fuse_session *se, struct fuse_chan *ch,
{
struct fuse_out_header *out = iov[0].iov_base;
+ assert(se != NULL);
out->len = iov_length(iov, count);
if (se->debug) {
if (out->unique == 0) {
@@ -189,8 +190,6 @@ static int fuse_send_msg(struct fuse_session *se, struct fuse_chan *ch,
int err = errno;
if (res == -1) {
- assert(se != NULL);
-
/* ENOENT means the operation was interrupted */
if (!fuse_session_exited(se) && err != ENOENT)
perror("fuse: writing device");