mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-17 07:11:29 +02:00
Merge pull request #275 from Oblivionsage/fix/unsigned-tx-amount-underflow
fix: prevent integer underflow in amount() bounds check
This commit is contained in:
@@ -19,7 +19,7 @@ QString UnsignedTransaction::errorString() const
|
||||
quint64 UnsignedTransaction::amount(size_t index) const
|
||||
{
|
||||
std::vector<uint64_t> arr = m_pimpl->amount();
|
||||
if(index > arr.size() - 1)
|
||||
if(arr.empty() || index >= arr.size())
|
||||
return 0;
|
||||
return arr[index];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user