From: Lennart Poettering Date: Fri, 20 Apr 2007 13:17:49 +0000 (+0000) Subject: avahi-ui: fix segfault when browsing for services in non-existing domains or domains... X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=8edd02efe5048c2eadcdf391951f607ab092eb89;p=catta avahi-ui: fix segfault when browsing for services in non-existing domains or domains that don't have any services assigned. git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1448 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-ui/avahi-ui.c b/avahi-ui/avahi-ui.c index a2a73d5..79aeb73 100644 --- a/avahi-ui/avahi-ui.c +++ b/avahi-ui/avahi-ui.c @@ -608,6 +608,7 @@ static const gchar *get_domain_name(AuiServiceDialog *d) { const gchar *domain; g_return_val_if_fail(d, NULL); + g_return_val_if_fail(AUI_IS_SERVICE_DIALOG(d), NULL); if (d->priv->domain) return d->priv->domain; @@ -692,7 +693,7 @@ static gboolean start_callback(gpointer data) { gtk_widget_show(d->priv->service_progress_bar); if (d->priv->service_pulse_timeout <= 0) - d->priv->service_pulse_timeout = g_timeout_add(100, service_pulse_callback, d->priv); + d->priv->service_pulse_timeout = g_timeout_add(100, service_pulse_callback, d); for (i = 0; d->priv->browse_service_types[i]; i++) ; @@ -872,7 +873,7 @@ static void domain_entry_changed_callback(GtkEditable *editable, gpointer user_d gtk_widget_set_sensitive(d->priv->domain_ok_button, is_valid_domain_suffix(gtk_entry_get_text(GTK_ENTRY(d->priv->domain_entry)))); } -static void domain_button_clicked(GtkButton *button, gpointer user_data) { +static void domain_button_clicked(GtkButton *button, gpointer user_data) { GtkWidget *vbox, *vbox2, *scrolled_window; GtkTreeSelection *selection; GtkCellRenderer *renderer;