Ethereal-dev: Re: [Ethereal-dev] XML escaping error in simple_dialog on GTK2

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

From: "Olivier Biot" <ethereal@xxxxxxxxxx>
Date: Sun, 2 May 2004 01:02:11 +0200
I just checked in a fix for this.

The problem is that in the GTK2 code we're using for rendering the
error messages we use XML constructs (or say HTML constructs). The
data which must be rendered must however be XML escaped, otherwise it
may wrongly be interpreted as GTK "make-up" instructions, resulting in
the incorrect rendering of the message text, and unwanted console
output.

For now I have only seen this error occurring at the display filter
parsing. There are two options here: either add the fix to the other
identified/identifiable places, or change the simple_dialog framework
so it takes more than one string as argument and we then always XML
escape if and when required (currently only for GTK2 dialogs).

Regards,

Olivier

----- Original Message ----- 
From: Olivier Biot

| Hi list!
|
| It looks like the display filter error messages are not "XML
escaped".
| When entering the following faulty display filter in a GTK2 build of
| Ethereal:
|
|     tcp contains "<pap
|
| I get a popup with the following message text:
|
|     <span weight="bold" size="larger">Syntax error.</span>
|
|     The display filter "tcp contains "<pap" is not a valid display
| filter.
|     See the help for a description of the display filter syntax.
|
| Additionally, the console spits the following message:
|
|     (lt-ethereal:576): Gtk-WARNING **: Failed to set label
|     from markup due to error parsing markup: Error on line 3
|     char 78: Odd character '"', expected a '>' or '/'
|     character to end the start tag of element 'pap', or
|     optionally an attribute; perhaps you used an invalid
|     character in an attribute name
|
| I think we will have to rewrite the simple_dialog code in file.c and
| other locations in such a way that error title and error description
| *can* be XML-escaped when required.
|
| The escaped printing can be recycled from print_escaped_xml() in
| print.c.