aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gns_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/gns_api.c')
-rw-r--r--src/gns/gns_api.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c
index 50f616716..00e96a61b 100644
--- a/src/gns/gns_api.c
+++ b/src/gns/gns_api.c
@@ -430,7 +430,7 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value)
430 const struct GNUNET_GNS_ClientResultMessage *gns_msg = cls; 430 const struct GNUNET_GNS_ClientResultMessage *gns_msg = cls;
431 struct GNUNET_GNS_LookupHandle *lookup_handle = value; 431 struct GNUNET_GNS_LookupHandle *lookup_handle = value;
432 const char *name = (const char*) &lookup_handle[1]; 432 const char *name = (const char*) &lookup_handle[1];
433 const struct GNUNET_GNS_Record *records; 433 const GNUNET_GNS_Record *records;
434 uint32_t num_records; 434 uint32_t num_records;
435 size_t meta_length; 435 size_t meta_length;
436 size_t msize; 436 size_t msize;
@@ -449,10 +449,10 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value)
449 num_records = ntohl (gns_msg->num_records); 449 num_records = ntohl (gns_msg->num_records);
450 meta_length = 450 meta_length =
451 sizeof (struct GNUNET_GNS_ClientResultMessage) + 451 sizeof (struct GNUNET_GNS_ClientResultMessage) +
452 sizeof (struct GNUNET_GNS_Record) * (num_records); 452 sizeof (GNUNET_GNS_Record) * (num_records);
453 if ((msize < meta_length) || 453 if ((msize < meta_length) ||
454 (num_records > 454 (num_records >
455 GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_GNS_Record))) 455 GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (GNUNET_GNS_Record)))
456 { 456 {
457 GNUNET_break (0); 457 GNUNET_break (0);
458 return GNUNET_NO; 458 return GNUNET_NO;
@@ -461,7 +461,7 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value)
461 LOG (GNUNET_ERROR_TYPE_DEBUG, "Giving %u byte reply for %s to application\n", 461 LOG (GNUNET_ERROR_TYPE_DEBUG, "Giving %u byte reply for %s to application\n",
462 (unsigned int) (msize - meta_length), GNUNET_h2s (key)); 462 (unsigned int) (msize - meta_length), GNUNET_h2s (key));
463#endif 463#endif
464 records = (const struct GNUNET_GNS_Record *) &gns_msg[1]; 464 records = (const GNUNET_GNS_Record *) &gns_msg[1];
465 lookup_handle->iter (lookup_handle->iter_cls, name, records, num_records); 465 lookup_handle->iter (lookup_handle->iter_cls, name, records, num_records);
466 return GNUNET_YES; 466 return GNUNET_YES;
467} 467}