Hello.

Attached patch fixes a regular segfault we got on FSO. The problem is that we
may not get the registration even it is mandatory. (To be fixed in fso as well)

We now have reg_stat with some random value in strcmp. Gives me a nice out of
bounds in gdb.

Also small sanity checks.

regards
Stefan Schmidt
Index: e_mod_gad_gsm.c
===================================================================
--- e_mod_gad_gsm.c	(revision 37564)
+++ e_mod_gad_gsm.c	(working copy)
@@ -353,7 +353,7 @@
 {
    /* We care only about the provider name right now. All the other status
     * informations get ingnored for the gadget for now */
-   const char *provider, *name, *reg_stat;
+   const char *provider = 0 , *name = 0, *reg_stat = 0;
    DBusMessageIter iter, a_iter, s_iter, v_iter;
    
    if (!dbus_message_has_signature(msg, "a{sv}")) return NULL;
@@ -380,10 +380,13 @@
 	dbus_message_iter_next(&a_iter);
      }
    
+   if (!reg_stat) return NULL;
    if (strcmp(reg_stat, "unregistered") == 0) provider = "No Service";
    else if (strcmp(reg_stat, "busy") == 0) provider = "Searching...";
    else if (strcmp(reg_stat, "denied") == 0) provider = "SOS only";
-   
+
+   if (!provider) return NULL;
+
    return strdup(provider);
 }
 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to