Re: [Wireshark-dev] strlen() and NULL pointer checks

2011-05-17 Thread Jeff Morriss
Jeff Morriss wrote: Jakub Zawadzki wrote: - I had the same issue with another project, and we created macro: #define __(x) ((x) ? (x) : "(null)") and use it when passing possible-null-strings. It's still PITA but IMHO it looks a little better than doing it by hand. I don't mind doing i

Re: [Wireshark-dev] strlen() and NULL pointer checks

2011-05-16 Thread Guy Harris
On May 16, 2011, at 2:53 PM, Jeff Morriss wrote: > But it is encouraging as they indicate that Solaris is the only "significant" > printf that is "good enough" except for this NULL pointer stuff. Well, > except for those poor sods running "insignificant" printfs. To be fair, what Owen said wa

Re: [Wireshark-dev] strlen() and NULL pointer checks

2011-05-16 Thread Jeff Morriss
Jakub Zawadzki wrote: On Mon, May 16, 2011 at 04:18:40PM -0400, Jeff Morriss wrote: Every once in a while, I do some fuzz testing on a Solaris/SPARC system. When I first did it I was primarily worried about getting bus errors (due to casts increasing alignment requirements), but usually what

Re: [Wireshark-dev] strlen() and NULL pointer checks

2011-05-16 Thread Jeff Morriss
Chris Maynard wrote: Jeff Morriss writes: Is there a better way? Or better yet, a proper solution? Not claiming this is better or proper, just another alternative: epan/strutil.c: #include size_t ws_strlen(const char *s) { if (s == NULL) return 0; return strlen(s); } Bu

Re: [Wireshark-dev] strlen() and NULL pointer checks

2011-05-16 Thread Jakub Zawadzki
On Mon, May 16, 2011 at 04:18:40PM -0400, Jeff Morriss wrote: > Every once in a while, I do some fuzz testing on a Solaris/SPARC system. > When I first did it I was primarily worried about getting bus errors > (due to casts increasing alignment requirements), but usually what I > find is anoth

Re: [Wireshark-dev] strlen() and NULL pointer checks

2011-05-16 Thread Gerald Combs
On 5/16/11 1:47 PM, Chris Maynard wrote: > Jeff Morriss writes: > >> Is there a better way? Or better yet, a proper solution? > > Not claiming this is better or proper, just another alternative: > > epan/strutil.c: > > #include > size_t ws_strlen(const char *s) > { > if (s == NULL) >

Re: [Wireshark-dev] strlen() and NULL pointer checks

2011-05-16 Thread Chris Maynard
Jeff Morriss writes: > Is there a better way? Or better yet, a proper solution? Not claiming this is better or proper, just another alternative: epan/strutil.c: #include size_t ws_strlen(const char *s) { if (s == NULL) return 0; return strlen(s); }

[Wireshark-dev] strlen() and NULL pointer checks

2011-05-16 Thread Jeff Morriss
Hi folks, Every once in a while, I do some fuzz testing on a Solaris/SPARC system. When I first did it I was primarily worried about getting bus errors (due to casts increasing alignment requirements), but usually what I find is another case of what I fixed in r37181. (Fortunately, I have n