소스 검색

Initialize the mock options in the fuzzing code

Fixes bug 24082; bugfix on 0.3.0.3-alpha.  Found by Brian Carpenter.
Nick Mathewson 6 년 전
부모
커밋
5dce134fbb
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      changes/bug24082
  2. 1 1
      src/test/fuzz/fuzzing_common.c

+ 3 - 0
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.

+ 1 - 1
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 */