[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/maint-0.3.1] Fix a coverity warning about a no-op assert with-64 bit size_t



commit 0c7c49483f53d8bc3da2d3e9ca62fc9810ccd05a
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Mon Jun 26 10:31:13 2017 -0400

    Fix a coverity warning about a no-op assert with-64 bit size_t
    
    This is CID 1403400
---
 src/common/storagedir.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/common/storagedir.c b/src/common/storagedir.c
index befcfe6..4405731 100644
--- a/src/common/storagedir.c
+++ b/src/common/storagedir.c
@@ -210,7 +210,9 @@ storage_dir_read(storage_dir_t *d, const char *fname, int bin, size_t *sz_out)
   char *contents = read_file_to_str(path, flags, &st);
   if (contents && sz_out) {
     // it fits in RAM, so we know its size is less than SIZE_MAX
+#if UINT64_MAX > SIZE_MAX
     tor_assert((uint64_t)st.st_size <= SIZE_MAX);
+#endif
     *sz_out = (size_t) st.st_size;
   }
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits