[gvfs] nfs: Handle NULL hostname



commit fafdb7d1fa61c991ad8f640f2458bcd67f65aa4b
Author: Ross Lagerwall <rosslagerwall gmail com>
Date:   Sun Mar 8 09:47:30 2015 +0000

    nfs: Handle NULL hostname
    
    Return an error if the hostname is NULL rather than crashing.

 daemon/gvfsbackendnfs.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsbackendnfs.c b/daemon/gvfsbackendnfs.c
index cf2f25f..617332b 100644
--- a/daemon/gvfsbackendnfs.c
+++ b/daemon/gvfsbackendnfs.c
@@ -190,6 +190,13 @@ do_mount (GVfsBackend *backend,
   };
 
   host = g_mount_spec_get (mount_spec, "host");
+  if (!host)
+    {
+      g_vfs_job_failed (G_VFS_JOB (job),
+                        G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+                        _("No hostname specified"));
+      return;
+    }
   export_list = mount_getexports (host);
 
   /* Find the shortest matching mount. E.g. if the given mount_prefix is


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]