diff options
author | Arkady Paronyan <arkady@comindware.com> | 2014-10-03 21:53:04 +0800 |
---|---|---|
committer | Arkady Paronyan <arkady@comindware.com> | 2014-10-03 21:53:04 +0800 |
commit | 77598cc3f09656c6ae037325aa3a0d04bb8eefbf (patch) | |
tree | cd7506529e6125aa1fa07c33dcb049c74b157453 /crypto.cpp | |
parent | 5e6121d3fe27ca9c93b99e5fa43a0e4a6465860c (diff) | |
download | dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar.gz dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar.bz2 dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar.lz dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar.xz dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar.zst dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.zip |
fixed segfaults on accessing temp objects vector buffers
Diffstat (limited to 'crypto.cpp')
-rw-r--r-- | crypto.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -46,12 +46,14 @@ BOOST_AUTO_TEST_CASE(crypto_tests) t.nonce = 0; t.receiveAddress = h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b")); t.value = 1000; - cnote << RLP(t.rlp(false)); - cnote << toHex(t.rlp(false)); + auto rlp = t.rlp(false); + cnote << RLP(rlp); + cnote << toHex(rlp); cnote << t.sha3(false); t.sign(p.secret()); - cnote << RLP(t.rlp(true)); - cnote << toHex(t.rlp(true)); + rlp = t.rlp(true); + cnote << RLP(rlp); + cnote << toHex(rlp); cnote << t.sha3(true); BOOST_REQUIRE(t.sender() == p.address()); } @@ -72,12 +74,14 @@ int cryptoTest() t.nonce = 0; t.receiveAddress = h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b")); t.value = 1000; - cnote << RLP(t.rlp(false)); - cnote << toHex(t.rlp(false)); + auto rlp = t.rlp(false); + cnote << RLP(rlp); + cnote << toHex(rlp); cnote << t.sha3(false); t.sign(p.secret()); - cnote << RLP(t.rlp(true)); - cnote << toHex(t.rlp(true)); + rlp = t.rlp(true); + cnote << RLP(rlp); + cnote << toHex(rlp); cnote << t.sha3(true); assert(t.sender() == p.address()); } |