gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xgnokii segfaults on empty ringtones list


From: Daniele Forsi
Subject: Re: xgnokii segfaults on empty ringtones list
Date: Fri, 30 Dec 2005 14:11:16 +0100
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)

Pawel Kot wrote:

Does the attached patch fix it for you?

no, it doesn't
now I see that list != NULL but list->selection == NULL

checking for list->selection (see attached patch) it segfaults later:

get_ringtone (w=0x81e52f0) at xgnokii_xring.c:730
730             gi.ringtone.location = ri->location;
(gdb) print ri
$1 = (gn_ringtone_info *) 0x0

--
Daniele
Index: xgnokii/xgnokii_xring.c
===================================================================
RCS file: /sources/gnokii/gnokii/xgnokii/xgnokii_xring.c,v
retrieving revision 1.6
diff -u -r1.6 xgnokii_xring.c
--- xgnokii/xgnokii_xring.c     10 Aug 2005 07:33:43 -0000      1.6
+++ xgnokii/xgnokii_xring.c     30 Dec 2005 13:04:13 -0000
@@ -428,10 +428,11 @@
 gn_ringtone_info *get_selected_ringtone(void)
 {
        GtkList *list;
-       int pos;
+       int pos = -1;

        list = GTK_LIST(GTK_COMBO(gi.rlist_combo)->list);
-       pos = gtk_list_child_position(list, list->selection->data);
+       if (list && list->selection)
+               pos = gtk_list_child_position(list, list->selection->data);

        if (pos < 0 || pos > gi.ringtone_list.count) return NULL;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]