[gvfs/gnome-3-20] google: Prevent potential crashes if resolve_dir fails
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/gnome-3-20] google: Prevent potential crashes if resolve_dir fails
- Date: Tue, 28 Mar 2017 13:48:23 +0000 (UTC)
commit 32378c1b098e4c61c938c849ac6593407dfcbba3
Author: Ondrej Holy <oholy redhat com>
Date: Fri Mar 17 13:54:15 2017 +0100
google: Prevent potential crashes if resolve_dir fails
Initialize pointers properly in order to avoid usage of unitialized,
or already freed memory.
This issues were revealed by coverity scan.
daemon/gvfsbackendgoogle.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gvfsbackendgoogle.c b/daemon/gvfsbackendgoogle.c
index 20853a4..9e70958 100644
--- a/daemon/gvfsbackendgoogle.c
+++ b/daemon/gvfsbackendgoogle.c
@@ -748,7 +748,7 @@ resolve_dir_and_rebuild (GVfsBackendGoogle *self,
GDataEntry *parent;
GDataEntry *ret_val = NULL;
GError *local_error;
- gchar *basename;
+ gchar *basename = NULL;
local_error = NULL;
parent = resolve_dir (self, filename, &basename, &local_error);
@@ -1184,6 +1184,7 @@ g_vfs_backend_google_copy (GVfsBackend *_self,
if (!destination_not_directory)
{
g_free (destination_basename);
+ destination_basename = NULL;
error = NULL;
destination_parent = resolve_dir (self, destination, &destination_basename, &error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]