diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-03-26 08:37:19 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-03-26 08:37:19 +0000 |
commit | bc355087f2eae41aff6c8b83e5c6cf1b3ff70966 (patch) | |
tree | c419add5d20d434645b166e763cc07d3fd4b54f0 | |
parent | cb63908a05c846bda608b091e2fced3a08472c1f (diff) | |
download | gnunet-bc355087f2eae41aff6c8b83e5c6cf1b3ff70966.tar.gz gnunet-bc355087f2eae41aff6c8b83e5c6cf1b3ff70966.zip |
-fix
-rw-r--r-- | src/gns/gnunet-service-gns.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 6acd2285c..2bd98fc10 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c | |||
@@ -469,6 +469,7 @@ static void handle_shorten(void *cls, | |||
469 | size_t msg_size = 0; | 469 | size_t msg_size = 0; |
470 | struct ClientShortenHandle *csh; | 470 | struct ClientShortenHandle *csh; |
471 | char name[MAX_DNS_NAME_LENGTH]; | 471 | char name[MAX_DNS_NAME_LENGTH]; |
472 | char* nameptr = name; | ||
472 | 473 | ||
473 | if (ntohs (message->size) < sizeof (struct GNUNET_GNS_ClientShortenMessage)) | 474 | if (ntohs (message->size) < sizeof (struct GNUNET_GNS_ClientShortenMessage)) |
474 | { | 475 | { |
@@ -495,7 +496,7 @@ static void handle_shorten(void *cls, | |||
495 | csh->client = client; | 496 | csh->client = client; |
496 | csh->unique_id = sh_msg->id; | 497 | csh->unique_id = sh_msg->id; |
497 | 498 | ||
498 | normalize_name((char*)&sh_msg[1], (char**)&name); | 499 | normalize_name((char*)&sh_msg[1], &nameptr); |
499 | 500 | ||
500 | if (strlen (name) < strlen(GNUNET_GNS_TLD)) { | 501 | if (strlen (name) < strlen(GNUNET_GNS_TLD)) { |
501 | csh->name = NULL; | 502 | csh->name = NULL; |
@@ -584,6 +585,7 @@ static void handle_get_authority(void *cls, | |||
584 | size_t msg_size = 0; | 585 | size_t msg_size = 0; |
585 | struct ClientGetAuthHandle *cah; | 586 | struct ClientGetAuthHandle *cah; |
586 | char name[MAX_DNS_NAME_LENGTH]; | 587 | char name[MAX_DNS_NAME_LENGTH]; |
588 | char* nameptr = name; | ||
587 | 589 | ||
588 | if (ntohs (message->size) < sizeof (struct GNUNET_GNS_ClientGetAuthMessage)) | 590 | if (ntohs (message->size) < sizeof (struct GNUNET_GNS_ClientGetAuthMessage)) |
589 | { | 591 | { |
@@ -606,7 +608,7 @@ static void handle_get_authority(void *cls, | |||
606 | return; | 608 | return; |
607 | } | 609 | } |
608 | 610 | ||
609 | normalize_name((char*)&sh_msg[1], (char**)&name); | 611 | normalize_name((char*)&sh_msg[1], &nameptr); |
610 | 612 | ||
611 | 613 | ||
612 | cah = GNUNET_malloc(sizeof(struct ClientGetAuthHandle)); | 614 | cah = GNUNET_malloc(sizeof(struct ClientGetAuthHandle)); |
@@ -713,6 +715,7 @@ handle_lookup(void *cls, | |||
713 | size_t namelen; | 715 | size_t namelen; |
714 | char name[MAX_DNS_NAME_LENGTH]; | 716 | char name[MAX_DNS_NAME_LENGTH]; |
715 | struct ClientLookupHandle *clh; | 717 | struct ClientLookupHandle *clh; |
718 | char* nameptr = name; | ||
716 | 719 | ||
717 | if (ntohs (message->size) < sizeof (struct GNUNET_GNS_ClientLookupMessage)) | 720 | if (ntohs (message->size) < sizeof (struct GNUNET_GNS_ClientLookupMessage)) |
718 | { | 721 | { |
@@ -735,7 +738,7 @@ handle_lookup(void *cls, | |||
735 | return; | 738 | return; |
736 | } | 739 | } |
737 | 740 | ||
738 | normalize_name((char*)&sh_msg[1], (char**)&name); | 741 | normalize_name((char*)&sh_msg[1], &nameptr); |
739 | namelen = strlen(name)+1; | 742 | namelen = strlen(name)+1; |
740 | clh = GNUNET_malloc(sizeof(struct ClientLookupHandle)); | 743 | clh = GNUNET_malloc(sizeof(struct ClientLookupHandle)); |
741 | clh->client = client; | 744 | clh->client = client; |