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
Provokes a signed overflow, which is reported by UBSAN, if TTL is larger than several hundred years. In particular, libp2p::peer::ttl::kPermanent does trigger the overflow. https://godbolt.org/z/ahcdE5Msq - an MRE.
Permanent ttl should be expressed in some valid way, and probably some type safer than chrono::milliseconds, that silently overflows, should be used in the interface.
Expected behavior
Expected defined behaviour.
Actual behavior
Actual behaviour is undefined due to signed overflow.
Summary
The following line
cpp-libp2p/src/peer/address_repository/inmem_address_repository.cpp
Line 103 in 093a3f7
Provokes a signed overflow, which is reported by UBSAN, if TTL is larger than several hundred years. In particular, libp2p::peer::ttl::kPermanent does trigger the overflow.
https://godbolt.org/z/ahcdE5Msq - an MRE.
Permanent ttl should be expressed in some valid way, and probably some type safer than chrono::milliseconds, that silently overflows, should be used in the interface.
Expected behavior
Expected defined behaviour.
Actual behavior
Actual behaviour is undefined due to signed overflow.
Relevant log output
Possible Solution
No response
Version
Commit c96d45f
Would you like to work on fixing this bug ?
Yes
The text was updated successfully, but these errors were encountered: