aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_server.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-09-02 10:01:43 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-09-02 10:01:43 +0000
commit432024ed47d536d7a58e2003e3449874e17001ef (patch)
tree920b8936f37cff96af490f2e0e4aa925da8a4fd8 /src/transport/plugin_transport_http_server.c
parente658c7a0303f1e5c59c66e0a9be29a74e08ab0cc (diff)
downloadgnunet-432024ed47d536d7a58e2003e3449874e17001ef.tar.gz
gnunet-432024ed47d536d7a58e2003e3449874e17001ef.zip
h_addr is a define in in netdb.h
leads to stack corruption -> rename variable
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r--src/transport/plugin_transport_http_server.c54
1 files changed, 26 insertions, 28 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index abf3fdacd..d102880eb 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -654,35 +654,33 @@ static int
654http_server_plugin_address_suggested (void *cls, const void *addr, 654http_server_plugin_address_suggested (void *cls, const void *addr,
655 size_t addrlen) 655 size_t addrlen)
656{ 656{
657 struct HttpAddressWrapper *next; 657 struct HttpAddressWrapper *next;
658 struct HttpAddressWrapper *pos; 658 struct HttpAddressWrapper *pos;
659 struct HttpAddress *h_addr; 659 const struct HttpAddress *haddr = addr;
660 h_addr = (struct HttpAddress *) addr; 660
661 661 if ((NULL != p->ext_addr) &&
662 if ((NULL != p->ext_addr) && 662 GNUNET_YES == (http_common_cmp_addresses (addr, addrlen,
663 GNUNET_YES == (http_common_cmp_addresses (addr, addrlen, 663 p->ext_addr, p->ext_addr_len)))
664 p->ext_addr, p->ext_addr_len))) 664 {
665 { 665 /* Checking HTTP_OPTIONS_VERIFY_CERTIFICATE option for external hostname */
666 /* Checking HTTP_OPTIONS_VERIFY_CERTIFICATE option for external hostname */ 666 if ((ntohl(haddr->options) & HTTP_OPTIONS_VERIFY_CERTIFICATE) !=
667 if ((ntohl(h_addr->options) & HTTP_OPTIONS_VERIFY_CERTIFICATE) != 667 (p->options & HTTP_OPTIONS_VERIFY_CERTIFICATE))
668 (p->options & HTTP_OPTIONS_VERIFY_CERTIFICATE))
669 return GNUNET_NO; /* VERIFY option not set as required! */ 668 return GNUNET_NO; /* VERIFY option not set as required! */
670 return GNUNET_OK; 669 return GNUNET_OK;
671 } 670 }
672 671
673 next = p->addr_head; 672 next = p->addr_head;
674 while (NULL != (pos = next)) 673 while (NULL != (pos = next))
675 { 674 {
676 next = pos->next; 675 next = pos->next;
677 if (GNUNET_YES == (http_common_cmp_addresses(addr, 676 if (GNUNET_YES == (http_common_cmp_addresses(addr,
678 addrlen, 677 addrlen,
679 pos->address, 678 pos->address,
680 pos->addrlen))) 679 pos->addrlen)))
681 return GNUNET_OK; 680 return GNUNET_OK;
682 681
683 } 682 }
684 683 return GNUNET_NO;
685 return GNUNET_NO;
686} 684}
687 685
688 686