diff options
Diffstat (limited to 'src/util/resolver_api.c')
-rw-r--r-- | src/util/resolver_api.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c index 8905810d4..f4832ed9c 100644 --- a/src/util/resolver_api.c +++ b/src/util/resolver_api.c | |||
@@ -426,12 +426,11 @@ GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched, | |||
426 | unsigned int i; | 426 | unsigned int i; |
427 | struct in_addr v4; | 427 | struct in_addr v4; |
428 | struct in6_addr v6; | 428 | struct in6_addr v6; |
429 | char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; | 429 | char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; |
430 | 430 | ||
431 | check_config (cfg); | 431 | check_config (cfg); |
432 | slen = strlen (hostname) + 1; | 432 | slen = strlen (hostname) + 1; |
433 | if (slen + sizeof (struct GNUNET_RESOLVER_GetMessage) > | 433 | if (slen + sizeof (struct GNUNET_RESOLVER_GetMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) |
434 | GNUNET_SERVER_MAX_MESSAGE_SIZE) | ||
435 | { | 434 | { |
436 | GNUNET_break (0); | 435 | GNUNET_break (0); |
437 | return NULL; | 436 | return NULL; |
@@ -619,7 +618,7 @@ GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched, | |||
619 | struct GNUNET_CLIENT_Connection *client; | 618 | struct GNUNET_CLIENT_Connection *client; |
620 | struct GNUNET_RESOLVER_GetMessage *msg; | 619 | struct GNUNET_RESOLVER_GetMessage *msg; |
621 | struct GNUNET_RESOLVER_RequestHandle *rh; | 620 | struct GNUNET_RESOLVER_RequestHandle *rh; |
622 | char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; | 621 | char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; |
623 | 622 | ||
624 | check_config (cfg); | 623 | check_config (cfg); |
625 | rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + salen); | 624 | rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + salen); |
@@ -636,8 +635,7 @@ GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched, | |||
636 | &numeric_reverse, rh); | 635 | &numeric_reverse, rh); |
637 | return rh; | 636 | return rh; |
638 | } | 637 | } |
639 | if (salen + sizeof (struct GNUNET_RESOLVER_GetMessage) > | 638 | if (salen + sizeof (struct GNUNET_RESOLVER_GetMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) |
640 | GNUNET_SERVER_MAX_MESSAGE_SIZE) | ||
641 | { | 639 | { |
642 | GNUNET_break (0); | 640 | GNUNET_break (0); |
643 | GNUNET_free (rh); | 641 | GNUNET_free (rh); |