Skip to content

Commit 2301588

Browse files
authored
Merge pull request #275 from Oblivionsage/fix/unsigned-tx-amount-underflow
fix: prevent integer underflow in amount() bounds check
2 parents 42dc35d + d248417 commit 2301588

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libwalletqt/UnsignedTransaction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ QString UnsignedTransaction::errorString() const
1919
quint64 UnsignedTransaction::amount(size_t index) const
2020
{
2121
std::vector<uint64_t> arr = m_pimpl->amount();
22-
if(index > arr.size() - 1)
22+
if(arr.empty() || index >= arr.size())
2323
return 0;
2424
return arr[index];
2525
}

0 commit comments

Comments
 (0)