]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Squelch a Coverity warning.
authorGuy Harris <[email protected]>
Wed, 18 Nov 2015 21:07:34 +0000 (13:07 -0800)
committerGuy Harris <[email protected]>
Wed, 18 Nov 2015 21:07:34 +0000 (13:07 -0800)
See Coverity CID 1324572 for tcpdump - the unsigned octets from the IPv6
address were getting extended to ints as a result of getting shifted
left by an int, so make the loop counter unsigned.

addrtostr.c

index e941d8e11c581af4cf761fa7c82a186a7bd7bac0..1ea792adc97451c55e6b1fe29291229faa59cf81 100644 (file)
@@ -113,7 +113,7 @@ addrtostr6 (const void *src, char *dst, size_t size)
     long len;
   } best, cur;
   u_long words [IN6ADDRSZ / INT16SZ];
     long len;
   } best, cur;
   u_long words [IN6ADDRSZ / INT16SZ];
-  int    i;
+  u_int  i;
 
   /* Preprocess:
    *  Copy the input (bytewise) array into a wordwise array.
 
   /* Preprocess:
    *  Copy the input (bytewise) array into a wordwise array.