Wireshark mailing list archives
Re: Possibly unsafe padding in Yahoo dissectors?
From: Guy Harris <guy () alum mit edu>
Date: Mon, 21 May 2012 14:37:56 -0700
On May 21, 2012, at 2:21 PM, Evan Huus wrote:
So my question is what people feel the best style is in this situation? 1. Replace the structure with a #define of the length, possibly leaving the struct #if 0'ed out for posterity. 2. Add some compiler hints to never pad the struct, but leave it as is. 3. Use this pattern in other places (possibly with the compiler hints as per 2), since the self-documentation is a good thing.
I vote for 1), and either put the struct into a comment or replace the struct with a description of the packet format, in, for example, prose form, or "boxes made out of plus signs and hyphens" form or.... 2) can be compiler-dependent, and not all compilers necessarily support those hints. ___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Possibly unsafe padding in Yahoo dissectors? Evan Huus (May 21)
- Re: Possibly unsafe padding in Yahoo dissectors? Guy Harris (May 21)