You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.
BugLevel: Tiny
Result: No impact in the near future
Summary: int64_t to unsigned casting while converting to RLP format.
BlockHeader::streamRLP using std::ostream& operator<<(std::ostream& _out, dev::RLP const& _d) to convert block header to RLP. In /libdevcore/RLP.h, it calls RLP::append in function operator <<. And RLP::append has unsigned, u160, u256 and bigint overloading. However, BlockHeader::m_timestamp and BlockHeader::m_number is int64_t which will match RLP::append<unsigned> and maybe cause a casting overflow since unsigned could be 32 bits in some platform.
This overflow could happen after about 150 years 😂.
BugLevel: Tiny
Result: No impact in the near future
Summary: int64_t to unsigned casting while converting to RLP format.
BlockHeader::streamRLP
usingstd::ostream& operator<<(std::ostream& _out, dev::RLP const& _d)
to convert block header to RLP. In /libdevcore/RLP.h, it callsRLP::append
in functionoperator <<
. AndRLP::append
hasunsigned
,u160
,u256
andbigint
overloading. However,BlockHeader::m_timestamp
andBlockHeader::m_number
isint64_t
which will matchRLP::append<unsigned>
and maybe cause a casting overflow sinceunsigned
could be 32 bits in some platform.This overflow could happen after about 150 years 😂.
The testing code could be:
Or a RLP test case:
Platform: Ubuntu 18.04
Compiler: GCC 7.5.0
The text was updated successfully, but these errors were encountered: