Merge pull request #275 from Oblivionsage/fix/unsigned-tx-amount-underflow

fix: prevent integer underflow in amount() bounds check
This commit is contained in:
tobtoht
2025-11-13 09:36:00 +00:00
committed by GitHub
+1 -1
View File
@@ -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];
}