From: Christian Grothoff Date: Sat, 13 Jan 2018 13:46:26 +0000 (+0100) Subject: do not die if client closes port it never opened X-Git-Tag: v0.11.0pre66~249^2~13 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=58e2f8eadb20e527ebcefc04a906fb1f0e856e31;p=oweals%2Fgnunet.git do not die if client closes port it never opened --- diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c index c3e99e0eb..20e4c363e 100644 --- a/src/cadet/gnunet-service-cadet.c +++ b/src/cadet/gnunet-service-cadet.c @@ -75,7 +75,7 @@ struct CadetClient * Handle to communicate with the client */ struct GNUNET_MQ_Handle *mq; - + /** * Client handle. */ @@ -536,6 +536,13 @@ handle_port_close (void *cls, "Closing port %s as requested by %s\n", GNUNET_h2s (&pmsg->port), GSC_2s (c)); + if (NULL == c->ports) + { + /* Client closed a port despite _never_ having opened one? */ + GNUNET_break (0); + GNUNET_SERVICE_client_drop (c->client); + return; + } op = GNUNET_CONTAINER_multihashmap_get (c->ports, &pmsg->port); if (NULL == op)