allow any zone if request was for NULL
authorChristian Grothoff <christian@grothoff.org>
Thu, 25 Oct 2018 08:25:01 +0000 (10:25 +0200)
committerChristian Grothoff <christian@grothoff.org>
Thu, 25 Oct 2018 08:58:10 +0000 (10:58 +0200)
src/namestore/namestore_api_monitor.c

index 2c4c4559d13ffc629631043bf880e02ac73dd4dc..457da0b90b7c763e8f450862646d5679928fa792 100644 (file)
@@ -129,6 +129,7 @@ static int
 check_result (void *cls,
               const struct RecordResultMessage *lrm)
 {
+  static struct GNUNET_CRYPTO_EcdsaPrivateKey zero;
   struct GNUNET_NAMESTORE_ZoneMonitor *zm = cls;
   size_t lrm_len;
   size_t exp_lrm_len;
@@ -139,9 +140,12 @@ check_result (void *cls,
   const char *rd_ser_tmp;
 
   (void) cls;
-  if (0 != memcmp (&lrm->private_key,
-                  &zm->zone,
-                  sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)))
+  if ( (0 != memcmp (&lrm->private_key,
+                    &zm->zone,
+                    sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) &&
+       (0 != memcmp (&zero,
+                    &zm->zone,
+                    sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) )
   {
     GNUNET_break (0);
     return GNUNET_SYSERR;