]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
If options_act() fails, restore the previous value of global_options
authorNick Mathewson <nickm@torproject.org>
Fri, 14 Sep 2018 14:34:45 +0000 (10:34 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 14 Sep 2018 14:34:45 +0000 (10:34 -0400)
Before 0.3.3.1-alpha, we would exit() in this case immediately.  But
now that we leave tor_main() more conventionally, we need to make
sure we restore things so as not to cause a double free.

Fixes bug 27708; bugfix on 0.3.3.1-alpha.

changes/bug27708 [new file with mode: 0644]
src/or/config.c

diff --git a/changes/bug27708 b/changes/bug27708
new file mode 100644 (file)
index 0000000..d283b19
--- /dev/null
@@ -0,0 +1,4 @@
+  o Major bugfixes (restart-in-process):
+    - Fix a use-after-free error that could be caused by passing Tor an
+      impossible set of options that would fail during options_act().
+      Fixes bug 27708; bugfix on 0.3.3.1-alpha.
index ac37324a2af9a9d33a83faa7a6d006390e06f735..58080c65e313c4bc0cceb7fd8c9fb0e11f74a981 100644 (file)
@@ -868,6 +868,7 @@ set_options(or_options_t *new_val, char **msg)
               "Acting on config options left us in a broken state. Dying.");
       tor_shutdown_event_loop_and_exit(1);
     }
+    global_options = old_options;
     return -1;
   }
   /* Issues a CONF_CHANGED event to notify controller of the change. If Tor is