[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r22146 - gnunet/src/gns
From: |
gnunet |
Subject: |
[GNUnet-SVN] r22146 - gnunet/src/gns |
Date: |
Wed, 20 Jun 2012 13:19:12 +0200 |
Author: schanzen
Date: 2012-06-20 13:19:12 +0200 (Wed, 20 Jun 2012)
New Revision: 22146
Modified:
gnunet/src/gns/gns_api.c
gnunet/src/gns/gnunet-service-gns_resolver.c
gnunet/src/gns/test_gns_pseu_shorten.c
Log:
-coverity
Modified: gnunet/src/gns/gns_api.c
===================================================================
--- gnunet/src/gns/gns_api.c 2012-06-20 11:12:26 UTC (rev 22145)
+++ gnunet/src/gns/gns_api.c 2012-06-20 11:19:12 UTC (rev 22146)
@@ -666,6 +666,11 @@
size_t key_len = 0;
char* pkey_tmp;
+ if (NULL == name)
+ {
+ return NULL;
+ }
+
if (NULL != shorten_key)
{
pkey_enc = GNUNET_CRYPTO_rsa_encode_key (shorten_key);
@@ -673,11 +678,6 @@
key_len = ntohs (pkey_enc->len);
}
- if (NULL == name)
- {
- return NULL;
- }
-
msize = sizeof (struct GNUNET_GNS_ClientLookupMessage)
+ key_len + strlen(name) + 1;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to lookup %s in GNS\n", name);
Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c 2012-06-20 11:12:26 UTC
(rev 22145)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c 2012-06-20 11:19:12 UTC
(rev 22146)
@@ -1399,8 +1399,8 @@
rd.flags = 0;
finish_lookup (rh, rlh, 1, &rd);
+ GNUNET_RESOLVER_request_cancel (rh->dns_resolver_handle);
free_resolver_handle (rh);
- GNUNET_RESOLVER_request_cancel (rh->dns_resolver_handle);
}
/**
@@ -1655,6 +1655,8 @@
struct sockaddr *sa;
int i;
struct RecordLookupHandle *rlh = rh->proc_cls;
+
+ memset (&packet, 0, sizeof (struct GNUNET_DNSPARSER_Packet));
/* We cancel here as to not include the ns lookup in the timeout */
if (rh->timeout_task != GNUNET_SCHEDULER_NO_TASK)
@@ -2516,8 +2518,9 @@
* would already have an entry in the NS for the record)
* 5. We are not in cache only mode
*/
- if (((rh->status & RSL_RECORD_EXPIRED) || (rh->status &!RSL_RECORD_EXISTS))
- && GNUNET_CRYPTO_short_hash_cmp(&rh->authority_chain_head->zone,
+ if (( ((rh->status & RSL_RECORD_EXPIRED) != 0) ||
+ ((rh->status & RSL_RECORD_EXISTS) == 0) ) &&
+ GNUNET_CRYPTO_short_hash_cmp(&rh->authority_chain_head->zone,
&rh->private_local_zone) &&
(strcmp(rh->name, "+") == 0) &&
(rh->only_cached == GNUNET_NO))
Modified: gnunet/src/gns/test_gns_pseu_shorten.c
===================================================================
--- gnunet/src/gns/test_gns_pseu_shorten.c 2012-06-20 11:12:26 UTC (rev
22145)
+++ gnunet/src/gns/test_gns_pseu_shorten.c 2012-06-20 11:19:12 UTC (rev
22146)
@@ -289,6 +289,7 @@
struct GNUNET_CRYPTO_RsaSignature *sig;
struct GNUNET_NAMESTORE_RecordData rd;
+ memset (&rd, 0, sizeof (struct GNUNET_NAMESTORE_RecordData));
rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value;
rd.data_size = strlen(TEST_PSEU_ALICE)+1;
rd.data = TEST_PSEU_ALICE;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r22146 - gnunet/src/gns,
gnunet <=