From 0a6ac36c18891cbff721def0f66dee9991c7c220 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 6 Mar 2012 13:16:33 +0000 Subject: [PATCH] - fix --- src/namestore/gnunet-service-namestore.c | 2 +- src/namestore/namestore_api.c | 3 ++- src/namestore/test_namestore_api_lookup_specific_type.c | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index b72dcd073..f7c5a3205 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -292,7 +292,7 @@ handle_lookup_name_it (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found %u records for name `%s' in zone `%s'\n", copied_elements, lnc->name, GNUNET_h2s(lnc->zone)); - if ((copied_elements == rd_count) && (signature != NULL)) + if ((copied_elements == rd_count) && (NULL != signature)) contains_signature = GNUNET_YES; else contains_signature = GNUNET_NO; diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index 49ab4b442..f96fc88cf 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c @@ -300,7 +300,8 @@ handle_lookup_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe, signature = &msg->signature; if (name_len == 0) name = NULL; - if ((name != NULL) && (signature != NULL) && (rd_count > 0)) + + if (name != NULL) public_key_tmp = &msg->public_key; else public_key_tmp = NULL; diff --git a/src/namestore/test_namestore_api_lookup_specific_type.c b/src/namestore/test_namestore_api_lookup_specific_type.c index 3f2098858..a74c602f2 100644 --- a/src/namestore/test_namestore_api_lookup_specific_type.c +++ b/src/namestore/test_namestore_api_lookup_specific_type.c @@ -195,14 +195,15 @@ void name_lookup_non_existing_record_type (void *cls, const struct GNUNET_CRYPTO_RsaSignature *signature) { int failed = GNUNET_NO; - - if ((NULL == zone_key) || (0 != memcmp(zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))) + /* We expect zone key != NULL, name != NULL, rd_count 0, rd NULL, signature NULL */ + if (NULL == zone_key) { GNUNET_break(0); failed = GNUNET_YES; } - if ((NULL == n) || (0 != strcmp(n, s_name))) + if (NULL == n) { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Name %s!\n", n); GNUNET_break(0); failed = GNUNET_YES; } -- 2.25.1