diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-05 20:57:02 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-05 20:57:02 +0000 |
commit | a6222ffe4a5a38c3fdfdc3774538c0daceda6b00 (patch) | |
tree | d38c0d030b11eeba69d9523792156984517d76b9 | |
parent | a65355f164607f544b62e36e0dcb0d8c2b0dad69 (diff) | |
download | gnunet-gtk-a6222ffe4a5a38c3fdfdc3774538c0daceda6b00.tar.gz gnunet-gtk-a6222ffe4a5a38c3fdfdc3774538c0daceda6b00.zip |
-fix access out of bounds, struct sockaddr_in6 is not the same as struct in6_addr, and we are just comparing the IPv6 IP here, not the rest
-rw-r--r-- | src/setup/gnunet-setup-transport.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/setup/gnunet-setup-transport.c b/src/setup/gnunet-setup-transport.c index 08cc39d9..e593ed2f 100644 --- a/src/setup/gnunet-setup-transport.c +++ b/src/setup/gnunet-setup-transport.c | |||
@@ -340,8 +340,9 @@ nipo (void *cls, const char *name, int isDefault, const struct sockaddr *addr, | |||
340 | if (!isDefault) | 340 | if (!isDefault) |
341 | return GNUNET_OK; | 341 | return GNUNET_OK; |
342 | if ( (sizeof (struct sockaddr_in6) == addrlen) && | 342 | if ( (sizeof (struct sockaddr_in6) == addrlen) && |
343 | (0 != memcmp (&in6addr_loopback, addr, | 343 | (0 != memcmp (&in6addr_loopback, |
344 | addrlen)) && | 344 | &((struct sockaddr_in6 *)addr)->sin6_addr, |
345 | sizeof (struct in6_addr))) && | ||
345 | (! IN6_IS_ADDR_LINKLOCAL(addr)) ) | 346 | (! IN6_IS_ADDR_LINKLOCAL(addr)) ) |
346 | { | 347 | { |
347 | *have_v6 = GNUNET_YES; | 348 | *have_v6 = GNUNET_YES; |