Skip to content

Commit 7a81f44

Browse files
wangchaoluleigreat
authored andcommitted
unsuitable parameter of sha512Half lead to crash in windows release version
1 parent d19c754 commit 7a81f44

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
@@ -194,9 +194,9 @@ bool Executive::executeCreate(AccountID const& _sender, uint256 const& _endowmen
194194

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

201201
return !m_ext;
202202
}

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)