Skip to content

Commit 7d36237

Browse files
committed
Merge #13776: net: Add missing verification of IPv6 address in CNetAddr::GetIn6Addr(...)
2fb0066 net: Add missing verification of IPv6 address in CNetAddr::GetIn6Addr(...) (practicalswift) Pull request description: Add missing verification of IPv6 address in `CNetAddr::GetIn6Addr(...)`. Tree-SHA512: 8b0681252eec9cf293a2043e99fdacec520e321b477d8aca1cbd6327b85bf6c5e8cd820fb914f097c62655947e88745ebccd824a78b995a8186e910e6fe520aa
2 parents 230652c + 2fb0066 commit 7d36237

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/netaddress.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ bool CNetAddr::GetInAddr(struct in_addr* pipv4Addr) const
300300

301301
bool CNetAddr::GetIn6Addr(struct in6_addr* pipv6Addr) const
302302
{
303+
if (!IsIPv6()) {
304+
return false;
305+
}
303306
memcpy(pipv6Addr, ip, 16);
304307
return true;
305308
}

0 commit comments

Comments
 (0)