summaryrefslogtreecommitdiff
path: root/gck/gck-attributes.c
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-11-03 14:34:46 +0100
committerStef Walter <stefw@collabora.co.uk>2011-11-03 14:34:46 +0100
commit794ca1502a562b20ace487c23bb15884df5dd3f3 (patch)
tree4dd82274820ea068436bc420c118f7b6e99dc91f /gck/gck-attributes.c
parent8667b2f7756b42a570ef1328d3f4658da7dffb3f (diff)
downloadgcr-794ca1502a562b20ace487c23bb15884df5dd3f3.tar.gz
gck: gck_attribute_get_string() should not return a NULL string
* Fix bug where a NULL string would be returned if the attribute was found but was invalid.
Diffstat (limited to 'gck/gck-attributes.c')
-rw-r--r--gck/gck-attributes.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gck/gck-attributes.c b/gck/gck-attributes.c
index 6f3b2ec..b94648e 100644
--- a/gck/gck-attributes.c
+++ b/gck/gck-attributes.c
@@ -1306,6 +1306,7 @@ gboolean
gck_attributes_find_string (GckAttributes *attrs, gulong attr_type, gchar **value)
{
GckAttribute *attr;
+ gchar *string;
g_return_val_if_fail (value, FALSE);
g_return_val_if_fail (!attrs->locked, FALSE);
@@ -1313,7 +1314,10 @@ gck_attributes_find_string (GckAttributes *attrs, gulong attr_type, gchar **valu
attr = gck_attributes_find (attrs, attr_type);
if (!attr || gck_attribute_is_invalid (attr))
return FALSE;
- *value = gck_attribute_get_string (attr);
+ string = gck_attribute_get_string (attr);
+ if (string == NULL)
+ return FALSE;
+ *value = string;
return TRUE;
}