Avoid potential null pointer dereference in CWalletTx::GetAvailableCredit(...).
Introduced in 4279da47855ec776f8d57c6579fe89afc9cbe8c1.
Avoid potential null pointer dereference in CWalletTx::GetAvailableCredit(...).
Introduced in 4279da47855ec776f8d57c6579fe89afc9cbe8c1.
1946 | @@ -1947,7 +1947,9 @@ CAmount CWalletTx::GetAvailableCredit(bool fUseCache, const isminefilter& filter 1947 | 1948 | if (cache) { 1949 | *cache = nCredit; 1950 | - *cache_used = true; 1951 | + if (cache_used) {
If cache is set then cache_used is also set. Maybe assert(cache_used) instead?
@promag Please re-review :-)
utACK d063303.
So is an assert acceptable here? When can this happen? Is it acceptable for the process to crash when it happens, or would this need actual error handling?
utACK d06330396f64b9a3a3016afc1f937633b4b322ab. They are always set in tandem. Though, there is no "potential null pointer dereference", please adjust the title.
Indeed
@MarcoFalke Thanks for the review and the utACK. Title now updated :-)