Skip to content

Commit cde8da2

Browse files
author
wangchao
committed
unsuitable parameter of sha512Half lead to crash in windows release version
1 parent 5d16087 commit cde8da2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/peersafe/app/misc/impl/Executive.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ bool Executive::executeCreate(AccountID const& _sender, uint256 const& _endowmen
193193

194194
// Schedule _init execution if not empty.
195195
Blob data;
196-
if (!_code.empty())
197-
m_ext = std::make_shared<ExtVM>(m_s, m_envInfo, m_newAddress, _sender, _origin,
198-
value, _gasPrice, &data, _code, sha512Half(_code.toBytes()), m_depth, true, false);
196+
if (!_code.empty())
197+
m_ext = std::make_shared<ExtVM>(m_s, m_envInfo, m_newAddress, _sender, _origin,
198+
value, _gasPrice, &data, _code, sha512Half(makeSlice(_code.toBytes())), m_depth, true, false);
199199

200200
return !m_ext;
201201
}

src/peersafe/app/misc/impl/SleOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace ripple {
9797
uint256 SleOps::codeHash(AccountID const& addr)
9898
{
9999
bytes const& code = SleOps::code(addr);
100-
return sha512Half(code);
100+
return sha512Half(makeSlice(code));
101101
}
102102

103103
TER SleOps::transferBalance(AccountID const& _from, AccountID const& _to, uint256 const& _value)

0 commit comments

Comments
 (0)