mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 12:22:39 -03:00
Merge #13776: net: Add missing verification of IPv6 address in CNetAddr::GetIn6Addr(...)
2fb0066b99
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
This commit is contained in:
commit
7d3623794a
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue