Commit 37d1e844 authored by Martin Hurtoň's avatar Martin Hurtoň

Merge pull request #396 from hintjens/master

Reverting fix for #393
parents 73f960e7 8d64fc6a
...@@ -371,10 +371,10 @@ zmq::tcp_address_t::tcp_address_t (const sockaddr *sa, socklen_t sa_len) ...@@ -371,10 +371,10 @@ zmq::tcp_address_t::tcp_address_t (const sockaddr *sa, socklen_t sa_len)
zmq_assert(sa && sa_len > 0); zmq_assert(sa && sa_len > 0);
memset (&address, 0, sizeof (address)); memset (&address, 0, sizeof (address));
if (sa->sa_family == AF_INET && (size_t) sa_len >= (socklen_t) sizeof (address.ipv4)) if (sa->sa_family == AF_INET && sa_len >= (socklen_t) sizeof (address.ipv4))
memcpy(&address.ipv4, sa, sizeof (address.ipv4)); memcpy(&address.ipv4, sa, sizeof (address.ipv4));
else else
if (sa->sa_family == AF_INET6 && (size_t) sa_len >= (socklen_t) sizeof (address.ipv6)) if (sa->sa_family == AF_INET6 && sa_len >= (socklen_t) sizeof (address.ipv6))
memcpy(&address.ipv6, sa, sizeof (address.ipv6)); memcpy(&address.ipv6, sa, sizeof (address.ipv6));
} }
...@@ -576,7 +576,7 @@ int zmq::tcp_address_mask_t::to_string (std::string &addr_) ...@@ -576,7 +576,7 @@ int zmq::tcp_address_mask_t::to_string (std::string &addr_)
const bool zmq::tcp_address_mask_t::match_address (const struct sockaddr *ss, const socklen_t ss_len) const const bool zmq::tcp_address_mask_t::match_address (const struct sockaddr *ss, const socklen_t ss_len) const
{ {
zmq_assert (address_mask != -1 && ss != NULL && (socklen_t) ss_len >= (socklen_t) sizeof (struct sockaddr)); zmq_assert (address_mask != -1 && ss != NULL && ss_len >= (socklen_t) sizeof (struct sockaddr));
if (ss->sa_family != address.generic.sa_family) if (ss->sa_family != address.generic.sa_family)
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment