diff --git a/ChangeLog b/ChangeLog index ea0069f8..1793af3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-21 Tatsuhiro Tsujikawa + + Added handling for the return values from + PeerMessageUtil::createcompact(). + * src/DefaultBtContext.cc (computeFastSet): + 2008-02-21 Tatsuhiro Tsujikawa Fixed abort when peer's ip address is IPv4-mapped address. diff --git a/src/DefaultBtContext.cc b/src/DefaultBtContext.cc index 23378656..ee15f4ed 100644 --- a/src/DefaultBtContext.cc +++ b/src/DefaultBtContext.cc @@ -387,7 +387,9 @@ std::deque DefaultBtContext::computeFastSet(const std::string& ipaddr, { std::deque fastSet; char compact[6]; - PeerMessageUtil::createcompact(compact, ipaddr, 0); + if(!PeerMessageUtil::createcompact(compact, ipaddr, 0)) { + return fastSet; + } unsigned char tx[24]; memcpy(tx, compact, 4); if((tx[0] & 0x80) == 0 || (tx[0] & 0x40) == 0) {