From 58e2f8eadb20e527ebcefc04a906fb1f0e856e31 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 13 Jan 2018 14:46:26 +0100 Subject: [PATCH] do not die if client closes port it never opened --- src/cadet/gnunet-service-cadet.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) -- 2.25.1