]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a segfault during startup
authorPeter Palfrader <peter@palfrader.org>
Sat, 6 Feb 2016 21:17:02 +0000 (22:17 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sat, 6 Feb 2016 21:17:02 +0000 (22:17 +0100)
If unix socket was configured as listener (such as a ControlSocket or a
SocksPort unix socket), and tor was started as root but not configured
to switch to another user, tor would segfault while trying to string
compare a NULL value.  Fixes bug 18261; bugfix on 0.2.8.1-alpha. Patch
by weasel.

changes/bug18261 [new file with mode: 0644]
src/or/connection.c

diff --git a/changes/bug18261 b/changes/bug18261
new file mode 100644 (file)
index 0000000..df4c74f
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor features (crypto):
+    - Fix a segfault during startup:  If unix socket was configured as
+      listener (such as a ControlSocket or a SocksPort unix socket), and
+      tor was started as root but not configured to switch to another
+      user, tor would segfault while trying to string compare a NULL
+      value.  Fixes bug 18261; bugfix on 0.2.8.1-alpha. Patch by weasel.
index 123c33a8762c98c9ecbf6a3f0b585b9ceaf790d5..efd730f5d56c6e58af74f8c3118324ba750daa8b 100644 (file)
@@ -2398,7 +2398,7 @@ retry_listener_ports(smartlist_t *old_conns,
     /* We don't need to be root to create a UNIX socket, so defer until after
      * setuid. */
     const or_options_t *options = get_options();
-    if (port->is_unix_addr && !geteuid() && strcmp(options->User, "root"))
+    if (port->is_unix_addr && !geteuid() && (options->User) && strcmp(options->User, "root"))
       continue;
 #endif