From ba93badf7398d18619c16d2ac2b35b543c268cd6 Mon Sep 17 00:00:00 2001 From: Michael Savisko Date: Thu, 11 Oct 2018 13:11:24 +0300 Subject: [PATCH] Fix crash of xrdp-chansrv process, issue #1202. In xfuse_create_file_in_xrdp_fs insure that xfuse_fs is properly initialized. --- sesman/chansrv/chansrv_fuse.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sesman/chansrv/chansrv_fuse.c b/sesman/chansrv/chansrv_fuse.c index ff50f136..3c227a53 100644 --- a/sesman/chansrv/chansrv_fuse.c +++ b/sesman/chansrv/chansrv_fuse.c @@ -1228,10 +1228,17 @@ xfuse_create_file_in_xrdp_fs(tui32 device_id, int pinode, const char *name, { XRDP_INODE *xinode; XRDP_INODE *xinodep; + time_t cur_time; if ((name == NULL) || (strlen(name) == 0)) return NULL; + /* Do we have an inode table yet? */ + if (xfuse_init_xrdp_fs()) + { + return NULL; + } + xinode = g_new0(XRDP_INODE, 1); if (xinode == NULL) { @@ -1239,6 +1246,8 @@ xfuse_create_file_in_xrdp_fs(tui32 device_id, int pinode, const char *name, return NULL; } + cur_time = time(0); + xinode->parent_inode = pinode; xinode->inode = g_xrdp_fs.next_node++; xinode->nlink = 1;