From 40cf5993c171d74d9ee298ea9aaa6540076bccf9 Mon Sep 17 00:00:00 2001 From: tequ Date: Fri, 30 Jan 2026 20:36:43 +0900 Subject: [PATCH] Add sanity check for sponsoringAccountCount = 0 --- src/xrpld/app/tx/detail/DeleteAccount.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xrpld/app/tx/detail/DeleteAccount.cpp b/src/xrpld/app/tx/detail/DeleteAccount.cpp index 36deee9b86..9bdb783d3f 100644 --- a/src/xrpld/app/tx/detail/DeleteAccount.cpp +++ b/src/xrpld/app/tx/detail/DeleteAccount.cpp @@ -410,6 +410,11 @@ DeleteAccount::doApply() auto const sponsoringAccountCount = sponsorSle->getFieldU32(sfSponsoringAccountCount); + if (sponsoringAccountCount == 0) + // sanity check + // Since sfSponsoringAccountCount is set to soeDEFAULT, the field will not be populated with a value of 0. + return tefINTERNAL; // LCOV_EXCL_LINE + if (sponsoringAccountCount == 1) sponsorSle->makeFieldAbsent(sfSponsoringAccountCount); else