From: Christian Grothoff Date: Mon, 26 Sep 2016 16:07:30 +0000 (+0000) Subject: -do not crash with NPE if bind fails X-Git-Tag: initial-import-from-subversion-38251~199 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=736ff56bade57c6b2e5f6b593d2f79e10d6e6705;p=oweals%2Fgnunet.git -do not crash with NPE if bind fails --- diff --git a/src/util/service_new.c b/src/util/service_new.c index 0b9e8fd82..c15d98161 100644 --- a/src/util/service_new.c +++ b/src/util/service_new.c @@ -1275,7 +1275,13 @@ setup_service (struct GNUNET_SERVICE_Handle *sh) slc->sh = sh; slc->listen_socket = open_listen_socket (addrs[i], addrlens[i]); - GNUNET_break (NULL != slc->listen_socket); + if (NULL == slc->listen_socket) + { + GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, + "bind"); + GNUNET_free (slc); + continue; + } GNUNET_CONTAINER_DLL_insert (sh->slc_head, sh->slc_tail, slc); @@ -1283,12 +1289,12 @@ setup_service (struct GNUNET_SERVICE_Handle *sh) } sh->require_found = tolerant ? GNUNET_NO : GNUNET_YES; - sh->match_uid = - GNUNET_CONFIGURATION_get_value_yesno (sh->cfg, + sh->match_uid + = GNUNET_CONFIGURATION_get_value_yesno (sh->cfg, sh->service_name, "UNIX_MATCH_UID"); - sh->match_gid = - GNUNET_CONFIGURATION_get_value_yesno (sh->cfg, + sh->match_gid + = GNUNET_CONFIGURATION_get_value_yesno (sh->cfg, sh->service_name, "UNIX_MATCH_GID"); process_acl4 (&sh->v4_denied,