]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a GCC 10.0.1 compilation warning.
authorNick Mathewson <nickm@torproject.org>
Fri, 1 May 2020 02:56:31 +0000 (22:56 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 1 May 2020 02:56:31 +0000 (22:56 -0400)
Fixes 34077 for 0.4.1; bugfix on 0.4.0.3-alpha. (Specifically, GCC
first gives this warning for 9eeff921ae7b786d960ea4286d5bba56)

changes/bug34077 [new file with mode: 0644]
src/feature/dirauth/shared_random_state.c

diff --git a/changes/bug34077 b/changes/bug34077
new file mode 100644 (file)
index 0000000..29458bd
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes (compiler warnings):
+    - Fix compilation warnings with GCC 10.0.1. Fixes bug 34077; bugfix on
+      0.4.0.3-alpha.
index b669e3836e9c3172c862c32a816c507cca3dd511..58c203e204d4c04f1da9400419c69a164fd6d96b 100644 (file)
@@ -1057,8 +1057,9 @@ sr_state_set_valid_after(time_t valid_after)
 sr_phase_t
 sr_state_get_phase(void)
 {
-  void *ptr;
+  void *ptr=NULL;
   state_query(SR_STATE_ACTION_GET, SR_STATE_OBJ_PHASE, NULL, &ptr);
+  tor_assert(ptr);
   return *(sr_phase_t *) ptr;
 }