mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add safe_cast (RIPD-1702):
This change ensures that no overflow can occur when casting between enums and integral types.
This commit is contained in:
committed by
Nik Bougalis
parent
494724578a
commit
148bbf4e8f
@@ -30,6 +30,7 @@
|
||||
#include <ripple/app/misc/ValidatorList.h>
|
||||
#include <ripple/app/tx/apply.h>
|
||||
#include <ripple/basics/random.h>
|
||||
#include <ripple/basics/safe_cast.h>
|
||||
#include <ripple/basics/UptimeClock.h>
|
||||
#include <ripple/beast/core/LexicalCast.h>
|
||||
#include <ripple/beast/core/SemanticVersion.h>
|
||||
@@ -192,7 +193,7 @@ PeerImp::send (Message::pointer const& m)
|
||||
return;
|
||||
|
||||
overlay_.reportTraffic (
|
||||
static_cast<TrafficCount::category>(m->getCategory()),
|
||||
safe_cast<TrafficCount::category>(m->getCategory()),
|
||||
false, static_cast<int>(m->getBuffer().size()));
|
||||
|
||||
auto sendq_size = send_queue_.size();
|
||||
|
||||
Reference in New Issue
Block a user