Bug#402715: gnome-hearts crashes on startup

2006-12-12 Thread Sander Marechal
Torbj|rn Andersson wrote:
> Package: gnome-hearts
> Version: 0.1.3-1
> Severity: grave
> 
> Hi,
> 
> I've already commented on this in bug #396043, but I'm afraid that it
> will get lost there, what with the Etch freeze

Nope, I spotted it. I just didn't have time to figure it all out.

> Incidentally, this is pretty much what it says in the original version
> of card_style_add(), before the Debian-specific patches have been
> applied, except that card_style_add is cast to a GHFunc. The patched
> line is identical to what it looked like in 0.1.2, though, so I guess
> the Debian patch just wasn't correctly updated to 0.1.3.

That's indeed what happened. And I didn't catch it earlier because my
personal apt repository overrides the standard one's. Oops... I'm
building gnome-hearts-0.1.3-2 with a corrected Debian patch as I'm
writing this.

Thanks for the report!

-- 
Sander Marechal


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#402715: gnome-hearts crashes on startup

2006-12-12 Thread Torbj|rn Andersson

Package: gnome-hearts
Version: 0.1.3-1
Severity: grave

Hi,

I've already commented on this in bug #396043, but I'm afraid that it will 
get lost there, what with the Etch freeze, and my problem doesn't appear 
to be quite the same as that one anyway (though it may have been 
introduced by the fix for it).


Basically, as soon as I try to start gnome-hearts, it crashes, rendering 
the package completely unusable for me. The reason for the crash appears 
to be the way load_card_styles() in hearts.c works. It assembles a hash 
table of all the available card styles, and then calls:


g_hash_table_foreach(game_card_styles, card_style_add, NULL);

This NULL pointer is passed as the 'first_style' parameter to 
card_style_add(), where it's dereferenced like this:


if (*first_style == NULL)
*first_style = g_string_new(value);

This, of course, causes a crash. So what it probably *should* say 
instead is something like this:


g_hash_table_foreach(game_card_style, card_style_add, &first_style);

Incidentally, this is pretty much what it says in the original version of 
card_style_add(), before the Debian-specific patches have been applied, 
except that card_style_add is cast to a GHFunc. The patched line is 
identical to what it looked like in 0.1.2, though, so I guess the Debian 
patch just wasn't correctly updated to 0.1.3.


Sincerely,

Torbjörn Andersson