]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'maint-0.2.9'
authorNick Mathewson <nickm@torproject.org>
Thu, 1 Dec 2016 14:50:17 +0000 (09:50 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 1 Dec 2016 14:50:17 +0000 (09:50 -0500)
1  2 
src/or/config.c
src/or/rendservice.c
src/test/test_hs.c

diff --cc src/or/config.c
Simple merge
index 8ffd0bc31907493bef5ad22bf1c29e794b7f6508,4d04da02aa821a0505dc5c0189cc6a6f4d48a35d..457821cb49680c50b52ace0683c5550e701d872c
@@@ -286,9 -296,9 +305,9 @@@ rend_add_service(smartlist_t *service_l
       * lock file.  But this is enough to detect a simple mistake that
       * at least one person has actually made.
       */
 -    if (service->directory != NULL) {
 +    if (!rend_service_is_ephemeral(service)) {
        /* Skip dupe for ephemeral services. */
-       SMARTLIST_FOREACH(rend_service_list, rend_service_t*, ptr,
+       SMARTLIST_FOREACH(s_list, rend_service_t*, ptr,
                          dupe = dupe ||
                                 !strcmp(ptr->directory, service->directory));
        if (dupe) {
          return -1;
        }
      }
-     smartlist_add(rend_service_list, service);
+     smartlist_add(s_list, service);
 -    log_debug(LD_REND,"Configuring service with directory \"%s\"",
 -              service->directory);
 +    log_debug(LD_REND,"Configuring service with directory %s",
 +              rend_service_escaped_dir(service));
      for (i = 0; i < smartlist_len(service->ports); ++i) {
        p = smartlist_get(service->ports, i);
        if (!(p->is_unix_addr)) {
@@@ -1009,7 -1062,12 +1074,12 @@@ service_is_single_onion_poisoned(const 
    char *poison_fname = NULL;
    file_status_t fstatus;
  
 -  if (!service->directory) {
+   /* Passing a NULL service is a bug */
+   if (BUG(!service)) {
+     return 0;
+   }
 +  if (rend_service_is_ephemeral(service)) {
      return 0;
    }
  
Simple merge