Wireshark-commits: [Wireshark-commits] rev 45461: /trunk-1.6/epan/dissectors/ /trunk-1.6/epan/disse

Date: Thu, 11 Oct 2012 02:18:37 GMT
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=45461

User: guy
Date: 2012/10/10 07:18 PM

Log:
 Copy over r54549 from trunk:
 
   r45459 | guy | 2012-10-10 17:02:14 -0700 (Wed, 10 Oct 2012) | 13 lines
 
   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.

Directory: /trunk-1.6/epan/dissectors/
  Changes    Path               Action
  +1 -1      packet-icmpv6.c    Modified