Revision: 43
http://gpredict.svn.sourceforge.net/gpredict/?rev=43&view=rev
Author: csete
Date: 2008-04-30 15:52:11 -0700 (Wed, 30 Apr 2008)
Log Message:
-----------
Fixed bug 1880815: Null pointer dereference causes crash on startup.
Modified Paths:
--------------
trunk/src/gtk-single-sat.c
Modified: trunk/src/gtk-single-sat.c
===================================================================
--- trunk/src/gtk-single-sat.c 2008-04-30 22:38:07 UTC (rev 42)
+++ trunk/src/gtk-single-sat.c 2008-04-30 22:52:11 UTC (rev 43)
@@ -254,7 +254,7 @@
/* create header */
sat = SAT (g_slist_nth_data (GTK_SINGLE_SAT (widget)->sats, 0));
- title = g_strdup_printf ("<b>%s</b>", sat->tle.sat_name);
+ title = g_strdup_printf ("<b>%s</b>", sat ? sat->tle.sat_name : "noname");
GTK_SINGLE_SAT (widget)->header = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (GTK_SINGLE_SAT (widget)->header), title);
@@ -398,6 +398,13 @@
/* get selected satellite */
sat = SAT (g_slist_nth_data (ssat->sats, ssat->selected));
+
+ if G_UNLIKELY(!sat) {
+ sat_log_log (SAT_LOG_LEVEL_BUG,
+ _("%s:%d: Can not update non-existing sat"),
+ __FILE__, __LINE__);
+ return;
+ }
/* update requested field */
switch (i) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|