Ethereal-dev: Re: [Ethereal-dev] Boldify deref's a NULL ptr and do we need bold fonts?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Sun, 8 Oct 2000 22:08:21 -0700
On Mon, Oct 09, 2000 at 12:18:00AM +0900, Richard Sharpe wrote:
> It is possible, when selecting fonts from the Edit->Preferences->GUI item
> to select a font size and not a font.
> 
> boldify (at about line 1414 in gtk/main.c) then dereferences a NULL pointer
> and core dumps ...

The only calls to "boldify()" in "gtk/gui_prefs.c" are one that passes
it the result of a "g_strdup()" of the result of
"gtk_font_selection_dialog_get_font_name()"; "g_strdup()" will return
NULL if it's handed NULL as an argument.

If that's where it blows up, then we need to check for a null
"font_name" value, and pop up a dialog box telling the user that they
haven't selected a font - if we skip the call to "boldify()", that'll
keep it from blowing up in "boldify()", but it'll just blow up later.

How do you arrange to select a font size and not a font?  I tried
un-selecting the font by clicking on the selected font, but I couldn't
reproduce the problem.