Skip to content

Commit 2fb0066

Browse files
net: Add missing verification of IPv6 address in CNetAddr::GetIn6Addr(...)
1 parent f58674a commit 2fb0066

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)