fix: add null SLE checks in directory callbacks - #7722
Conversation
|
Hi @BraedonKlock. Thank you for your contributions! We really appreciate them. At this point, we ask that you hold off on submitting any more until we've had a chance to review the current batch. There is a not insignificant engineer overhead for each review, and it may take some time to get caught up. Too many PRs can make that harder. When we've gotten down to 3 open or fewer, feel free to create more! In the meantime, you can open "Draft" PRs so that changes will be ready to go once we're ready for more. At that time, you'll be able to decide which ones are the best, and convert them to "Ready to review". Keep in mind that you will be responsible for keeping your PRs up to date with |
|
Thank you @ximinez for the clarification! I really appreciate the feedback. I completely understand. I'll hold off on opening additional ready for review PRs until my open count is down to three or fewer. In the meantime, I'll continue working locally and use draft PRs if appropriate. Thanks again! |
High Level Overview of Change
Adds null
SLEchecks in directory iteration callbacks forNoRippleCheckandGatewayBalances.This prevents possible null pointer dereferences if directory iteration passes a null ledger entry to the callback.
Fixes #7510.
Context of Change
forEachItemAfterinNoRippleCheckandforEachIteminGatewayBalancesboth receivestd::shared_ptr<SLE const>values from directory iteration.This change adds the missing checks before calling
getType()in both affected callbacks:NoRippleCheck: returnsfalsewhenownedItemis nullGatewayBalances: returns early whensleis nullAPI Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)