Fix a crash in funcsig_hash

Ryan Gammon rgammon at real.com
Thu Jun 16 11:52:51 PDT 2005


I was trying out registering some custom marshallers with the glib 
bindings, and came across a crash in dbus-gobject.c: funcsig_hash where:

sig->params = NULL
sig->n_params = 0

Maybe something like the below is a step in the right direction.

diff -u -r1.27 dbus-gobject.c
--- dbus-gobject.c      14 Jun 2005 15:55:10 -0000      1.27
+++ dbus-gobject.c      16 Jun 2005 18:55:09 -0000
@@ -1314,11 +1314,12 @@
   const DBusGFuncSignature *sig = key;
   GType *types;
   guint ret;
+  guint i;

   ret = sig->rettype;
   types = sig->params;

-  while (*types != G_TYPE_INVALID)
+  for (i = 0; i < sig->n_params; i++)
     {
       ret += (int) (*types);
       types++;

-- 
Ryan Gammon
rgammon at real.com
Developer for Helix Player
https://player.helixcommunity.org



More information about the dbus mailing list