Skip to content

IPv6 & operator throws an exception when scope = 0 #1552

@devslash-sec

Description

@devslash-sec

The bit wise & operator throws an "Invalid argument: Invalid address length passed to IPAddress()" when applying it on two IPv6 addresses e.g.: 2001:4860:4860::8888 and f000:: .
The error seems to be thrown by IPAddress::IPAddress(const void* addr, poco_socklen_t length, Poco::UInt32 scope) when called in IPAddress IPAddress::operator & (const IPAddress& other) const with IPAddress(r.addr(), r.scope(), sizeof(struct in6_addr));.

This seems to be wrong, it should be IPAddress(r.addr(), sizeof(struct in6_addr),r.scope());

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions