From 9ea68dbb9c4e57fe4d936be5912f6b68e6b18405 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 24 Apr 2009 17:29:57 +0000 Subject: [PATCH] fixed bug where an asio exception could be thrown when resolving peer countries --- ChangeLog | 2 ++ src/torrent.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e922053cc..5134dc743 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,6 +59,8 @@ release 0.14.3 * fixed potential crash on shutdown * fixed leaking exception from bdecode on malformed input * fixed bug where connection would hang when receiving a keepalive + * fixed bug where an asio exception could be thrown when resolving + peer countries release 0.14.2 diff --git a/src/torrent.cpp b/src/torrent.cpp index c4981c676..5e6631029 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -2889,7 +2889,7 @@ namespace libtorrent { unsigned long swap_bytes(unsigned long a) { - return (a >> 24) | ((a & 0xff0000) >> 8) | ((a & 0xff00) << 8) | (a << 24); + return (a >> 24) | ((a & 0xff0000) >> 8) | ((a & 0xff00) << 8) | ((a & 0xff) << 24); } }