Git-Url:
http://git.frugalware.org/gitweb/gitweb.cgi?p=fw-control-center.git;a=commitdiff;h=77a3fd64b73a4494e6a8d1e953019f0a43086a52
commit 77a3fd64b73a4494e6a8d1e953019f0a43086a52
Author: Priyank <[EMAIL PROTECTED]>
Date: Tue Nov 13 09:37:41 2007 +0530
gnetconfig-interface
* Fixed another possibility of a segfault.
Never use fwnet_lastprofile() directly in a strcmp() as it may return NULL.
Thanks to melodie_
diff --git a/gnetconfig/src/gnetconfig-interface.c
b/gnetconfig/src/gnetconfig-interface.c
index 5dfc4bd..10fda96 100644
--- a/gnetconfig/src/gnetconfig-interface.c
+++ b/gnetconfig/src/gnetconfig-interface.c
@@ -765,16 +765,20 @@ cb_gn_interface_start (GtkButton *button, gpointer data)
gboolean found = FALSE;
fwnet_interface_t* inte = NULL;
gint ret;
+ gchar *old_profile = NULL;
gtk_combo_box_get_active_iter (GTK_COMBO_BOX(gn_profile_combo), &iter);
model = gtk_combo_box_get_model (GTK_COMBO_BOX(gn_profile_combo));
- gtk_tree_model_get (model, &iter, 1, &profile, -1);
- if (strcmp(profile,fwnet_lastprofile())!=0)
+ gtk_tree_model_get (model, &iter, 1, &profile, -1);
+ old_profile = fwnet_lastprofile ();
+ if (old_profile!=NULL)
{
- gn_error (_("This interface cannot be activated. It belongs to
an inactive profile."));
- return;
+ if (strcmp(profile,old_profile)!=0)
+ {
+ gn_error (_("This interface cannot be activated. It
belongs to an inactive profile."));
+ return;
+ }
}
-
model = gtk_tree_view_get_model (GTK_TREE_VIEW(gn_interface_treeview));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(gn_interface_treeview));
if ( FALSE == gtk_tree_selection_get_selected (selection, &model, &iter) )
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git