[gcr] gck: gck_attribute_get_string() should not return a NULL string
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcr] gck: gck_attribute_get_string() should not return a NULL string
- Date: Thu, 3 Nov 2011 13:35:24 +0000 (UTC)
commit 794ca1502a562b20ace487c23bb15884df5dd3f3
Author: Stef Walter <stefw collabora co uk>
Date: Thu Nov 3 14:34:46 2011 +0100
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.
gck/gck-attributes.c | 6 +++++-
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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]