do not crash if service violates IPC protocol
authorChristian Grothoff <christian@grothoff.org>
Tue, 24 Apr 2018 08:06:08 +0000 (10:06 +0200)
committerChristian Grothoff <christian@grothoff.org>
Tue, 24 Apr 2018 08:06:26 +0000 (10:06 +0200)
src/util/resolver_api.c

index b92fd6a02dd0c127358a4fa002d43cb647724602..365b9960bba31c9ea2f9cecf1279f409f682d939 100644 (file)
@@ -478,7 +478,15 @@ handle_response (void *cls,
   char *nret;
 
   (void) cls;
-  GNUNET_assert (NULL != rh);
+  if (NULL == rh)
+  {
+    /* Resolver service sent two replies to one query? Bad! */
+    GNUNET_break (0);
+    GNUNET_MQ_destroy (mq);
+    mq = NULL;
+    reconnect ();
+    return;
+  }
   size = ntohs (msg->size);
   if (size == sizeof (struct GNUNET_MessageHeader))
   {