Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-commits: [Wireshark-commits] rev 41576: /trunk-1.6/ /trunk-1.6/epan/dissectors/: packet-i

Date: Thu, 15 Mar 2012 21:47:57 GMT
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=41576

User: gerald
Date: 2012/03/15 02:47 PM

Log:
 Copy over r40967 from the trunk:
 
   ------------------------------------------------------------------------
   r40967 | guy | 2012-02-10 23:12:34 -0800 (Fri, 10 Feb 2012) | 37 lines
   Changed paths:
      M /trunk/epan/dissectors/packet-ieee80211.c
 
   Don't use 16-bit integers as counters.  The code won't be any faster on
   anything that can run Wireshark (it might be slower), and if the maximum
   count value is 16-bit, you can loop forever if the maximum count value
   happens to be 65535.
 
   (Yes, this means that
 
   	guint i, j;
 
   		...
 
   	for (i = 0; i < j; i++)
   		...
 
   risks looping forever if j is 2^32-1, and the same applies to 64-bit
   counters.  There are probably fewer protocols with 32-bit counts, and
   probably even fewer with 64-bit counts, but the way it should be done in
   those cases, for safety, is
 
   	i = 0;
   	for (;;) {
   		if (i >= j)
   			break;
 
   		...
 
   		if (i == j - 1)
   			break;
   	}
 
   or something such as that.)
 
   Fixes bug 6809.
 
   #BACKPORT
   Will schedule for 1.6.x.
 
   ------------------------------------------------------------------------

Directory: /trunk-1.6/epan/dissectors/
  Changes    Path                  Action
  +5 -3      packet-ieee80211.c    Modified

Directory: /trunk-1.6/docbook/
  Changes    Path                 Action
  +19 -0     release-notes.xml    Modified