skalenetwork / skale-consensus

Running the very core of SKL network, SKALE BFT consensus is universal, modern, modular, high-performance, asynchronous, provably-secure, agent-based Proof-of-Stake blockchain consensus engine in C++ 17. Includes provably secure embedded Oracle. Used by SKALE elastic blockchains. Easy and flexible enough to implement your own blockchain or smart contract platform. BLS signatures and Binary Asynchronous Consensus are main building blocks.
https://docs.skale.network/technology/consensus-spec
GNU Affero General Public License v3.0
78 stars 32 forks source link

Memory error from adding char* and int #798

Closed dimalit closed 1 year ago

dimalit commented 1 year ago

Sometimes, consensus contain lines similar to: LOG( info, "Pushed block to skaled:" + _lastCommittedBlockID );

Effectively, it instructs compiler to take address of constant character string in memory, then add some offset to it, and interpret resulting address as a new string for logging. This causes access to some random memory address. All such cases should use to_string() itoa() etc.