diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-03-23 10:17:41 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-03-23 10:17:41 +0000 |
commit | 6d49a88f63282e4171d82b96177ecd9ca5441f1c (patch) | |
tree | d12435b6d66dc895a6745b2664d70baab1a42bea /src/voip-input-widget.c | |
parent | 6375d3eb602251a2374944817e34b9695ae50b65 (diff) | |
parent | a82ab70e9e82f09ba3d2446dba1b57ead1bde5f8 (diff) | |
download | ayatana-indicator-sound-6d49a88f63282e4171d82b96177ecd9ca5441f1c.tar.gz ayatana-indicator-sound-6d49a88f63282e4171d82b96177ecd9ca5441f1c.tar.bz2 ayatana-indicator-sound-6d49a88f63282e4171d82b96177ecd9ca5441f1c.zip |
protection against rogue dbusmenu properties
Diffstat (limited to 'src/voip-input-widget.c')
-rw-r--r-- | src/voip-input-widget.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/voip-input-widget.c b/src/voip-input-widget.c index dcf858e..1b36496 100644 --- a/src/voip-input-widget.c +++ b/src/voip-input-widget.c @@ -141,6 +141,7 @@ voip_input_widget_property_update (DbusmenuMenuitem* item, gchar* property, } if(g_ascii_strcasecmp(DBUSMENU_VOIP_INPUT_MENUITEM_MUTE, property) == 0){ if(priv->grabbed == FALSE){ + g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_INT32)); GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_voip_input_slider); GtkRange *range = (GtkRange*)slider; gint update = g_variant_get_int32 (value); @@ -149,8 +150,10 @@ voip_input_widget_property_update (DbusmenuMenuitem* item, gchar* property, level = 0; } else{ - level = g_variant_get_double (dbusmenu_menuitem_property_get_variant (priv->twin_item, - DBUSMENU_VOIP_INPUT_MENUITEM_LEVEL)); + GVariant* variant = dbusmenu_menuitem_property_get_variant (priv->twin_item, + DBUSMENU_VOIP_INPUT_MENUITEM_LEVEL); + g_return_if_fail (g_variant_is_of_type (variant, G_VARIANT_TYPE_DOUBLE)); + level = g_variant_get_double (variant); } gtk_range_set_value(range, level); |