]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix crash on HUP with mixed ephemeral services
authorJohn Brooks <john.brooks@dereferenced.net>
Sun, 17 May 2015 01:50:18 +0000 (19:50 -0600)
committerJohn Brooks <john.brooks@dereferenced.net>
Sun, 17 May 2015 02:01:38 +0000 (20:01 -0600)
Ephemeral services will be listed in rend_services_list at the end of
rend_config_services, so it must check whether directory is non-NULL
before comparing.

This crash happens when reloading config on a tor with mixed configured
and ephemeral services.

Fixes bug #16060. Bugfix on 0.2.7.1-alpha.

changes/bug16060 [new file with mode: 0644]
src/or/rendservice.c

diff --git a/changes/bug16060 b/changes/bug16060
new file mode 100644 (file)
index 0000000..eb0b50f
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (hidden service):
+    - Fix a crash when reloading configuration while at least one
+      configured and one ephemeral hidden service exists. Fixes bug 16060;
+      bugfix on 0.2.7.1-alpha.
index e170760ece8390a2b440a53cc695e8cffa33b057..daca4ccda4ec3f1782cb9c0d1b412607c981fb3b 100644 (file)
@@ -709,7 +709,8 @@ rend_config_services(const or_options_t *options, int validate_only)
      * probably ok? */
     SMARTLIST_FOREACH_BEGIN(rend_service_list, rend_service_t *, new) {
       SMARTLIST_FOREACH_BEGIN(old_service_list, rend_service_t *, old) {
-        if (!strcmp(old->directory, new->directory)) {
+        if (new->directory && old->directory &&
+            !strcmp(old->directory, new->directory)) {
           smartlist_add_all(new->intro_nodes, old->intro_nodes);
           smartlist_clear(old->intro_nodes);
           smartlist_add(surviving_services, old);