diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2012-12-07 17:00:42 +0100 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2012-12-07 17:00:42 +0100 |
commit | bf5493fc31ca6555390a076d7ce18872b7c0c0ec (patch) | |
tree | 4b8b97bb395ae11852ca50f3c2ef4d41a61600bf /common | |
parent | 3c1b401670c7fbdf7ad8f3034b3d508ae719d6d3 (diff) | |
download | gvfs-bf5493fc31ca6555390a076d7ce18872b7c0c0ec.tar.gz |
Fix use of uninitialized values
Diffstat (limited to 'common')
-rw-r--r-- | common/gmountspec.c | 2 | ||||
-rw-r--r-- | common/gvfsdaemonprotocol.c | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/common/gmountspec.c b/common/gmountspec.c index 1e34d791..ac9b66cd 100644 --- a/common/gmountspec.c +++ b/common/gmountspec.c @@ -494,7 +494,7 @@ g_mount_spec_new_from_string (const gchar *str, item.value = g_uri_unescape_string (tokens[1], NULL); if (strcmp (tokens[0], "prefix") == 0) { - g_free (item.key); + g_free (mount_prefix); mount_prefix = item.value; } else diff --git a/common/gvfsdaemonprotocol.c b/common/gvfsdaemonprotocol.c index a77e9962..6485854e 100644 --- a/common/gvfsdaemonprotocol.c +++ b/common/gvfsdaemonprotocol.c @@ -277,6 +277,8 @@ _g_dbus_get_file_attribute (GVariant *value, else if (g_variant_is_container (v)) { *type = G_FILE_ATTRIBUTE_TYPE_OBJECT; + obj_type = G_MAXUINT32; /* treat it as an error if not set below */ + str = NULL; if (g_variant_is_of_type (v, G_VARIANT_TYPE ("(u)"))) { @@ -292,8 +294,15 @@ _g_dbus_get_file_attribute (GVariant *value, /* obj_type 1 and 2 are deprecated and treated as errors */ if (obj_type == 3) { - /* serialized G_ICON */ - obj = (GObject *)g_icon_new_for_string (str, NULL); + if (str != NULL) + { + /* serialized G_ICON */ + obj = (GObject *)g_icon_new_for_string (str, NULL); + } + else + { + g_warning ("Malformed object data in file attribute"); + } } else { |