- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Yikes (and Frist?) ! I had almost forgotten about that one, and Remy’s article just appears when I have to dig into that part again … Well I can remember it made me pretty worked up at the time. At least I know what I am getting into now.
Edit Admin
Either it's meaningless because
s.sortiesis an actual array, and therefore not a NULL pointer (and therefore it is always true), or becauses.sortiesis an actual pointer, in which case the condition is false ifnumerois zero and the pointer is NULL (NULL+0 == NULL which casts toboolasfalse), andtruein all other cases, including cases which are UB (NULL+non_zero).However, if
s.sortiesis uninitialised, we're immediately into first-stripe UB territory for reading from an uninitialised variable.