do not crash for #4588
authorChristian Grothoff <christian@grothoff.org>
Thu, 23 Jun 2016 20:01:41 +0000 (20:01 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 23 Jun 2016 20:01:41 +0000 (20:01 +0000)
src/core/core_api.c

index 7699f8b74abbd7e0fc64949cffa11ac09815ce6f..451b871fb2fbdeb45e253d0f5b5e480dcc793ae5 100644 (file)
@@ -963,6 +963,11 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle,
   struct SendMessageRequest *smr;
   struct GNUNET_MQ_Envelope *env;
 
+  if (NULL == handle->mq)
+  {
+    GNUNET_break (0); /* SEE #4588: do not call NTR from disconnect notification! */
+    return NULL;
+  }
   GNUNET_assert (NULL != notify);
   if ( (notify_size > GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE) ||
        (notify_size + sizeof (struct SendMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) )