]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
util/map_anon_nofork: Add a cast to avoid passing -48 to memset
authorNick Mathewson <nickm@torproject.org>
Thu, 3 Oct 2019 11:21:25 +0000 (07:21 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 3 Oct 2019 11:21:25 +0000 (07:21 -0400)
This fixes coverity CID 1454593, and bug 31948. Bug not in any
released version of Tor.

src/test/test_util.c

index 5024b23400e5e1b0a7c027bcd6c00637e0c279d8..aebefe64c570d337f8c9da1e04e5c80f252a0ab2 100644 (file)
@@ -6197,7 +6197,7 @@ test_util_map_anon_nofork(void *arg)
   tor_munmap_anonymous(ptr, sz);
   ptr = tor_mmap_anonymous(sz, ANONMAP_NOINHERIT, &inherit);
   tt_ptr_op(ptr, OP_NE, 0);
-  memset(ptr, TEST_VALUE, sz);
+  memset(ptr, (uint8_t)TEST_VALUE, sz);
 
   tt_int_op(0, OP_EQ, pipe(pipefd));
   pid_t child = fork();