[Repository Listing] / [Wireshark]
Wireshark development

We've moved to Git

On January 28, 2014 we migrated from Subversion to Git. Please go to our code review site for current development activity.

Revision 45459

Jump to revision: Previous Next
Author: guy
Date: Thu Oct 11 00:02:14 2012 UTC (3 years, 8 months ago)
Log Message:
The usual idiom in C for "do this N times" is "for (i = 0; i < N; i++)",
not "for (i = 1; i < N+1; i++)".

Even if it weren't the idiom, it'd be safer, at least for unsigned
values, as, if i and N are the same width, and N has the maximum
possible value for that width, the first of those runs i from 0 to N-1,
all of which fit in a variable of that width, and the second of those
runs i from 1 to N, the latter of which doesn't fit into a variable of
that width, so modulo arithmetic turns it into 0 and the loop keeps
running forever.

Fixes bug 7844.

Changed paths

Path Action
trunk/epan/dissectors/packet-icmpv6.c trunk/epan/dissectors/packet-icmpv6.c modified Revision Log
Diff to Previous

webmaster [at] wireshark.org
Tango Icons © Tango Desktop Project. Subversion  TortoiseSVN  ViewVC