diff options
author | Ondrej Holy <oholy@redhat.com> | 2017-03-17 14:44:43 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2017-03-28 15:29:12 +0200 |
commit | e99210a564b125540daf510b449450d967d1f21b (patch) | |
tree | 70208400ff2380a1ad391b93232368906c40f272 | |
parent | 284b997da3cf7b948e870aeb2626597c41152e13 (diff) | |
download | gvfs-e99210a564b125540daf510b449450d967d1f21b.tar.gz |
fuse: Prevent potential crash if file handle is not set
File handle may be NULL, so it has to be checked before dereferencing.
This issue was revealed by coverity scan.
-rw-r--r-- | client/gvfsfusedaemon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c index 95432953..ab0d20bf 100644 --- a/client/gvfsfusedaemon.c +++ b/client/gvfsfusedaemon.c @@ -2018,7 +2018,7 @@ vfs_truncate (const gchar *path, off_t size) if (fh) g_mutex_lock (&fh->mutex); - if (fh->stream && fh->op == FILE_OP_WRITE) + if (fh && fh->stream && fh->op == FILE_OP_WRITE) { result = truncate_stream (file, fh, size); } |