From bcb7659504c0b0ba6ab0fe0db930b686381da9ab Mon Sep 17 00:00:00 2001
From: winndows <winndows@163.com>
Date: Sat, 11 Jul 2020 02:58:07 +0800
Subject: [PATCH 2/2] 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>
---
 lib/fuse_lowlevel.c | 3 +--
 1 file changed, 1 insertion(+), 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");
-- 
1.8.3.1

