fix #4383
authorChristian Grothoff <christian@grothoff.org>
Fri, 30 Sep 2016 12:58:01 +0000 (12:58 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 30 Sep 2016 12:58:01 +0000 (12:58 +0000)
src/pt/gnunet-daemon-pt.c

index 443ff8ae6e4b714662741102708915aba071c228..06ef888322732fb6dff89abb397334307e550645 100644 (file)
@@ -342,6 +342,12 @@ try_open_exit ()
   for (pos = exit_head; NULL != pos; pos = pos->next)
     if (NULL == pos->cadet_channel)
       candidate_count++;
+  if (0 == candidate_count)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "No DNS exits available yet.\n");
+    return;
+  }
   candidate_selected = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
                                                 candidate_count);
   candidate_count = 0;