Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 2504] Slow response when using Expert Info Composite

Date: Sun, 27 Apr 2008 22:57:00 -0700 (PDT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2504


Jim Young <jyoung@xxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1747|                            |review_for_checkin?
               Flag|                            |




--- Comment #3 from Jim Young <jyoung@xxxxxxx>  2008-04-27 22:56:59 GMT ---
Created an attachment (id=1747)
 --> (http://bugs.wireshark.org/bugzilla/attachment.cgi?id=1747)
quick and dirty patch to make expert_tapdata_t structs consistent

Hello All,

I was running Wireshark within valgrind and spotted one issue when using the
Expert Info Composite window.

Both of the Expert Info dialogs define and use a typedef called
expert_tapdata_t.  One version of the typedef is defined in the expert_dlg.c
file, while the other is defined in expert_comp_table.h.

The typedef defined in expert_dlg.c includes 12 fields whereas the one defined
in expert_comp_table.h has 11 fields.  Within expert_dlg.c's typedef the 3rd
field is a 'GtkCList *table'.  The 'GtkCList *table' field is not present in
expert_comp_table.h's typedef.

Assuming that GtkClist pointers are 4 bytes in length, any etd variables
allocated within expert_comp_init() at expert_comp_dlg.c:187, will be four
bytes smaller (44 bytes) then etd variables allocated within expert_dlg_init()
at expert_dlg:493 (48 bytes).

Both expert info dialogs share some common tap functions, which reference
fields defined inside the etd variables.  valgrind alerted to the fact that
expert_dlg's expert_dlg_draw() was attempting to access the variable
"etd->severity_report_level" which was beyond the end of the allocated block of
data.  This particular etd structure was allocated from within
expert_comp_init().

A quick and dirty fix is to simply insert the missing 'GtkCList *table;'
statement as the 3rd field within expert_comp_dlg.h's expert_tapdata_t typedef.
This is NOT a satisfactory long term fix because it still allows for the two
expert_tapdata_t definitions to diverge.

A much better fix would be to refactor the expert*.c code so that both dialogs
include the expert_tapdata_t definition from a common header file.

The attached patch is the quick and dirty fix.


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.