[Xfce4-commits] [xfce/xfce4-panel] 01/01: Prevent panel crash on unsupported GValues in PluginEvents

noreply at xfce.org noreply at xfce.org
Thu Jul 20 00:54:22 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-panel.

commit 4cfb1f81bfe8084ed7430817e37f32125d2417ae
Author: Ali Abdallah <ali at xfce.org>
Date:   Thu Jul 20 00:52:15 2017 +0200

    Prevent panel crash on unsupported GValues in PluginEvents
    
    A non supported gvalue that slips into PluginEvent causes the panel to crash,
    due to an assertion failure in the convertion between the GValue and the
    GVariant. So throw a warning instead.
    
    Example to trigger the crash
    dbus-send --session --type=method_call --print-reply \
    --dest='org.xfce.Panel' '/org/xfce/Panel' \
    'org.xfce.Panel.PluginEvent' string:whiskermenu \
    string:popup variant:byte:'a'
    
    Unless we want the conversion to handle all possible types,
    throwing just a warning instead of crashing is the good way to go.
---
 panel/panel-plugin-external-wrapper.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/panel/panel-plugin-external-wrapper.c b/panel/panel-plugin-external-wrapper.c
index 85e82f4..d36e5fb 100644
--- a/panel/panel-plugin-external-wrapper.c
+++ b/panel/panel-plugin-external-wrapper.c
@@ -285,6 +285,8 @@ panel_plugin_external_wrapper_gvalue_prop_to_gvariant (const GValue *value)
     case G_TYPE_STRING:
       type = G_VARIANT_TYPE_STRING;
       break;
+    /* only throw a warning (instead of an assertion) here as otherwise invalid
+       types sent to the panel via dbus would let the panel crash */
     default:
       g_warn_if_reached ();
     }
@@ -326,6 +328,7 @@ panel_plugin_external_wrapper_set_properties (PanelPluginExternal *external,
       else
         {
           g_warning ("Failed to convert wrapper property from gvalue:%s to gvariant", G_VALUE_TYPE_NAME(&property->value));
+          return;
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list