From a520441e3a1f60802a9c5e926647a96e4940f677 Mon Sep 17 00:00:00 2001 From: DanS Date: Tue, 14 Jul 2026 11:21:28 -0500 Subject: [PATCH] fix(rpc): guard z_validateaddress against null pwalletMain under -disablewallet #11 (HIGH) z_validateaddress locked LOCK2(cs_main, pwalletMain->cs_wallet) with no availability guard; under -disablewallet pwalletMain is NULL, so the member deref SIGSEGVs the daemon (execute() only catches std::exception). Use the null-safe LOCK2 idiom already used by sibling RPCs so validation still works without a wallet. Co-Authored-By: Claude Opus 4.8 --- src/rpc/misc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index c048b305d..0cf02813d 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -560,7 +560,7 @@ UniValue z_validateaddress(const UniValue& params, bool fHelp, const CPubKey& my #ifdef ENABLE_WALLET - LOCK2(cs_main, pwalletMain->cs_wallet); + LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL); #else LOCK(cs_main); #endif