[gvfs] fuse: Prevent potential crash if file handle is not set
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] fuse: Prevent potential crash if file handle is not set
- Date: Thu, 23 Mar 2017 11:46:23 +0000 (UTC)
commit e0905e89c606596fb88bf1127497077577e6347b
Author: Ondrej Holy <oholy redhat com>
Date: Fri Mar 17 14:44:43 2017 +0100
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.
client/gvfsfusedaemon.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index 80385b4..5a7767c 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -2032,7 +2032,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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]