aboutsummaryrefslogtreecommitdiff
path: root/src/netaddress.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2018-07-27 08:41:20 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2018-07-27 08:41:20 +0200
commit2fb0066b9932f3725a5a0533530453c6da4010ce (patch)
treedcb2f9ebeac40282d1cc0b00a7279ca324d263fa /src/netaddress.cpp
parentf58674a20a127f104409e11c5c11591533ddf360 (diff)
net: Add missing verification of IPv6 address in CNetAddr::GetIn6Addr(...)
Diffstat (limited to 'src/netaddress.cpp')
-rw-r--r--src/netaddress.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/netaddress.cpp b/src/netaddress.cpp
index 5ccbabd03d..193582d14e 100644
--- a/src/netaddress.cpp
+++ b/src/netaddress.cpp
@@ -300,6 +300,9 @@ bool CNetAddr::GetInAddr(struct in_addr* pipv4Addr) const
bool CNetAddr::GetIn6Addr(struct in6_addr* pipv6Addr) const
{
+ if (!IsIPv6()) {
+ return false;
+ }
memcpy(pipv6Addr, ip, 16);
return true;
}