summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2014-03-03 15:39:53 +0100
committerStef Walter <stefw@gnome.org>2014-03-03 15:39:53 +0100
commit63f7a6a2d6967e00a4e88ba47734c5c81be5e07f (patch)
tree5e33fcf2f516b9735f55fbbe532cad3227c93dcd
parent71f14c8b537bdd0703e190ed1d1556c965eaac9a (diff)
gck: Add some precondition checks to gck_attributes_find_xxxx()
-rw-r--r--gck/gck-attributes.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gck/gck-attributes.c b/gck/gck-attributes.c
index d08f879..81716a2 100644
--- a/gck/gck-attributes.c
+++ b/gck/gck-attributes.c
@@ -2188,6 +2188,7 @@ gck_attributes_find (GckAttributes *attrs,
gboolean
gck_attributes_find_boolean (GckAttributes *attrs, gulong attr_type, gboolean *value)
{
+ g_return_val_if_fail (attrs != NULL, FALSE);
g_return_val_if_fail (value, FALSE);
return find_attribute_boolean (attrs->data, attrs->count, attr_type, value);
@@ -2210,6 +2211,7 @@ gck_attributes_find_boolean (GckAttributes *attrs, gulong attr_type, gboolean *v
gboolean
gck_attributes_find_ulong (GckAttributes *attrs, gulong attr_type, gulong *value)
{
+ g_return_val_if_fail (attrs != NULL, FALSE);
g_return_val_if_fail (value, FALSE);
return find_attribute_ulong (attrs->data, attrs->count, attr_type, value);
@@ -2232,6 +2234,7 @@ gck_attributes_find_ulong (GckAttributes *attrs, gulong attr_type, gulong *value
gboolean
gck_attributes_find_string (GckAttributes *attrs, gulong attr_type, gchar **value)
{
+ g_return_val_if_fail (attrs != NULL, FALSE);
g_return_val_if_fail (value, FALSE);
return find_attribute_string (attrs->data, attrs->count, attr_type, value);
@@ -2254,6 +2257,7 @@ gck_attributes_find_string (GckAttributes *attrs, gulong attr_type, gchar **valu
gboolean
gck_attributes_find_date (GckAttributes *attrs, gulong attr_type, GDate *value)
{
+ g_return_val_if_fail (attrs != NULL, FALSE);
g_return_val_if_fail (value, FALSE);
return find_attribute_date (attrs->data, attrs->count, attr_type, value);