diff options
author | wachs <wachs@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-03-06 13:01:31 +0000 |
---|---|---|
committer | wachs <wachs@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-03-06 13:01:31 +0000 |
commit | 682f53c40e62eee8c7ebaf229a72612de6248b60 (patch) | |
tree | 5964c5cbed6526118bc6cba2f8859a630ce785a9 | |
parent | bf154bb9f348c680f8bd09eba0b5f803fe20cdda (diff) |
- fixes
git-svn-id: https://gnunet.org/svn/gnunet@20308 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 6 | ||||
-rw-r--r-- | src/namestore/namestore_api.c | 14 | ||||
-rw-r--r-- | src/namestore/test_namestore_api.conf | 2 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 8153cf20b9..b72dcd0738 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -311,7 +311,11 @@ handle_lookup_name_it (void *cls, lnr_msg->rd_len = htons (rd_ser_len); lnr_msg->name_len = htons (name_len); lnr_msg->expire = GNUNET_TIME_absolute_hton(expire); - lnr_msg->public_key = (*zone_key); + if (zone_key != NULL) + lnr_msg->public_key = (*zone_key); + else + memset(&lnr_msg->public_key, '\0', sizeof (lnr_msg->public_key)); + lnr_msg->contains_sig = htons (contains_signature); if (GNUNET_YES == contains_signature) lnr_msg->signature = *signature; diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index 195c8a9bd5..49ab4b4425 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c @@ -259,6 +259,7 @@ handle_lookup_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe, struct GNUNET_CRYPTO_RsaSignature *signature = NULL; struct GNUNET_TIME_Absolute expire; + struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key_tmp; size_t exp_msg_len; size_t msg_len = 0; size_t name_len = 0; @@ -284,11 +285,6 @@ handle_lookup_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe, GNUNET_break_op (0); return; } - if (name_len == 0) - { - GNUNET_break_op (0); - return; - } name = (char *) &msg[1]; rd_tmp = &name[name_len]; @@ -302,10 +298,16 @@ handle_lookup_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe, signature = NULL; else signature = &msg->signature; + if (name_len == 0) + name = NULL; + if ((name != NULL) && (signature != NULL) && (rd_count > 0)) + public_key_tmp = &msg->public_key; + else + public_key_tmp = NULL; if (qe->proc != NULL) { - qe->proc (qe->proc_cls, &msg->public_key, expire, name, rd_count, (rd_count > 0) ? rd : NULL, signature); + qe->proc (qe->proc_cls, public_key_tmp, expire, name, rd_count, (rd_count > 0) ? rd : NULL, signature); } /* Operation done, remove */ diff --git a/src/namestore/test_namestore_api.conf b/src/namestore/test_namestore_api.conf index f4cd32dbdc..c437b414a1 100644 --- a/src/namestore/test_namestore_api.conf +++ b/src/namestore/test_namestore_api.conf @@ -4,7 +4,7 @@ DEFAULTSERVICES = namestore UNIXPATH = /tmp/gnunet-p1-service-arm.sock [namestore] -#PREFIX = valgrind --leak-check=full +PREFIX = valgrind --leak-check=full AUTOSTART = YES UNIXPATH = /tmp/gnunet-service-namestore.sock UNIX_MATCH_UID = YES |