Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68088 - trunk/boost/asio/ip/impl
From: chris_at_[hidden]
Date: 2011-01-13 04:13:32


Author: chris_kohlhoff
Date: 2011-01-13 04:13:30 EST (Thu, 13 Jan 2011)
New Revision: 68088
URL: http://svn.boost.org/trac/boost/changeset/68088

Log:
Fix out-of-bounds address_v4::broadcast() return value on 64-bit systems.
Text files modified:
   trunk/boost/asio/ip/impl/address_v4.ipp | 2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)

Modified: trunk/boost/asio/ip/impl/address_v4.ipp
==============================================================================
--- trunk/boost/asio/ip/impl/address_v4.ipp (original)
+++ trunk/boost/asio/ip/impl/address_v4.ipp 2011-01-13 04:13:30 EST (Thu, 13 Jan 2011)
@@ -141,7 +141,7 @@
 
 address_v4 address_v4::broadcast(const address_v4& addr, const address_v4& mask)
 {
- return address_v4(addr.to_ulong() | ~mask.to_ulong());
+ return address_v4(addr.to_ulong() | (mask.to_ulong() ^ 0xFFFFFFFF));
 }
 
 address_v4 address_v4::netmask(const address_v4& addr)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk