[tor-commits] [tor/release-0.3.2] Initialize the mock options in the fuzzing code

nickm at torproject.org nickm at torproject.org
Tue Oct 31 18:32:01 UTC 2017


commit 5dce134fbb4310704c6e9dcffca61221671d6e47
Author: Nick Mathewson <nickm at torproject.org>
Date:   Mon Oct 30 17:05:26 2017 -0400

    Initialize the mock options in the fuzzing code
    
    Fixes bug 24082; bugfix on 0.3.0.3-alpha.  Found by Brian Carpenter.
---
 changes/bug24082               | 3 +++
 src/test/fuzz/fuzzing_common.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/changes/bug24082 b/changes/bug24082
new file mode 100644
index 000000000..152323935
--- /dev/null
+++ b/changes/bug24082
@@ -0,0 +1,3 @@
+  o Minor bugfixes (testing):
+    - Fix a spurious fuzzing-only use of an uninitialized value.
+      Found by Brian Carpenter. Fixes bug 24082; bugfix on 0.3.0.3-alpha.
diff --git a/src/test/fuzz/fuzzing_common.c b/src/test/fuzz/fuzzing_common.c
index 7aee92df6..7ebddde1a 100644
--- a/src/test/fuzz/fuzzing_common.c
+++ b/src/test/fuzz/fuzzing_common.c
@@ -107,7 +107,7 @@ global_init(void)
   configure_backtrace_handler(get_version());
 
   /* set up the options. */
-  mock_options = tor_malloc(sizeof(or_options_t));
+  mock_options = tor_malloc_zero(sizeof(or_options_t));
   MOCK(get_options, mock_get_options);
 
   /* Make BUG() and nonfatal asserts crash */





More information about the tor-commits mailing list