ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-users: Re: [Ethereal-users] Crash on copy to clipboard

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

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Fri, 20 Jan 2006 16:48:16 +0100
Ethereal user support <ethereal-users@xxxxxxxxxxxx> schrieb am 20.01.06 16:09:02:
> 
> Hi list,
> 
> Ethereal 0.10.14 on WinXP
> Capture some traffic, then stop
> Goto Statistics, Conversations
> Select the tab with 1 entry (or is it TCP, as in my case)
> Click copy button
> 
> This results in most cases in an application error. The callstack shows
> that it comes from gtk_clipboard_set_text(cb, CSV_str, -1); in
> copy_as_csv_cb(GtkWindow *win _U_, gpointer data) in conversation_table.c
> What I do see is that the end of the string is no longer the "\n" catted
> to the end but another character followed by the '\0'.
> 
> Can anyone reproduce this bug?
> 

Yes, it's certainly a bug in gtk/conversations_table.c, where the line 1153 simply allocates (80*num_conversations) chars to hold the output string and then simply strcat() all the text into this memory area.

Of course, the conversation text will never, never by larger than 80 chars, so this will never ever overflow ;-)

Another example of incompetent usage of strcat() ...

We might want to use GLib's GString for this, just as it's correctly done in gtk/ hostlist_table.c function copy_as_csv (line 581).

The same applies to gtk/expert_comp_table.c

Regards, ULFL



______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193