The sum of a guint16 and 2 does not necessarily fit in a guint16. Put
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 13 Nov 2011 01:38:46 +0000 (01:38 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 13 Nov 2011 01:38:46 +0000 (01:38 +0000)
it into a gint, instead.  This should fix bug 6572, by preventing an
infinite loop if the sum in question is 0 modulo 2^16.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39817 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-ua.c

index cd9f813c93ddbecfc3cab11db08edf795ca0056a..b5921d16a6531ffa138786479dde10ac742ac242 100644 (file)
@@ -277,7 +277,7 @@ static const value_string szTlvProperty[] =
 gboolean is_ua(tvbuff_t *tvb)
 {
     gint nLen, iOffs;
-    guint16 nNoeLen;
+    gint nNoeLen;
 
     nLen = tvb_length(tvb);
     for(iOffs = 0; iOffs < nLen; )