ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-bugs: [Wireshark-bugs] [Bug 2981] Patch to add extension support to the X11 dissector

Date: Mon, 2 Mar 2009 13:38:26 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2981


Peter Harris <wireshark@xxxxxxxxxxxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #2792|review_for_checkin?         |
               Flag|                            |
Attachment #2792 is|0                           |1
           obsolete|                            |
   Attachment #2799|                            |review_for_checkin?
               Flag|                            |




--- Comment #13 from Peter Harris <wireshark@xxxxxxxxxxxxxxxxxxx>  2009-03-02 13:38:22 PDT ---
Created an attachment (id=2799)
 --> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=2799)
Patch to add extension support v4: Use _U_ for unreferenced
variables/functions, fix infinite loop found by fuzz

Ah, I was unaware that Wireshark had the _U_ define. Thanks! Patch updated.

I've uploaded a half a dozen .pcap files to the Wiki's SampleCaptures page.
Fuzz testing over those files turned up an infinite loop in GLX/Render when the
length field on the wire is invalid. Fixed in v4 of the patch.

I did double-check the definition of _U_. It only appears to be defined for
gcc. The attribute is described as useful for C++ objects where the constructor
and destructor are important, but the object is otherwise never used, so it
sounds safe to use it on variables/functions that are actually referenced.

v4 also uses "static _U_" for a few functions that were previously non-static.
This is a good thing: it cuts down on namespace pollution, and it should (in
theory) allow the linker to eliminate a few of the functions (except on
Windows, where it could already toss unreferenced functions, due to Windows
forcing the equivalent of -fvisibility=hidden).

I'm a little queasy about -Wall -Werror -- some day, gcc will start warning
about something else (eg: non-system defines of reserved names (such as those
that start with an underscore followed by a capital letter)), and the build
will error. But that's beyond the scope of this particular patch.


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