[tor-commits] [tor/master] Suppress coverity warning about overflowing in safe_mem_is_zero

nickm at torproject.org nickm at torproject.org
Thu Aug 21 16:14:09 UTC 2014


commit 917e1042f75e9db2836def41210fa756c8ca3a85
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Aug 21 10:44:13 2014 -0400

    Suppress coverity warning about overflowing in safe_mem_is_zero
    
    The unsigned underflow here is defined and intentional.
    
    CID 202482
---
 src/common/di_ops.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/common/di_ops.c b/src/common/di_ops.c
index f03b2b7..a8bfd02 100644
--- a/src/common/di_ops.c
+++ b/src/common/di_ops.c
@@ -218,6 +218,7 @@ safe_mem_is_zero(const void *mem, size_t sz)
     total |= *ptr++;
   }
 
+  /*coverity[overflow]*/
   return 1 & ((total - 1) >> 8);
 }
 





More information about the tor-commits mailing list