Skip to content

fix: add null SLE checks in directory callbacks - #7722

Open
BraedonKlock wants to merge 1 commit into
XRPLF:developfrom
BraedonKlock:fix-missing-null-sle-checks
Open

fix: add null SLE checks in directory callbacks#7722
BraedonKlock wants to merge 1 commit into
XRPLF:developfrom
BraedonKlock:fix-missing-null-sle-checks

Conversation

@BraedonKlock

Copy link
Copy Markdown

High Level Overview of Change

Adds null SLE checks in directory iteration callbacks for NoRippleCheck and GatewayBalances.

This prevents possible null pointer dereferences if directory iteration passes a null ledger entry to the callback.

Fixes #7510.

Context of Change

forEachItemAfter in NoRippleCheck and forEachItem in GatewayBalances both receive std::shared_ptr<SLE const> values from directory iteration.

This change adds the missing checks before calling getType() in both affected callbacks:

  • NoRippleCheck: returns false when ownedItem is null
  • GatewayBalances: returns early when sle is null

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@ximinez

ximinez commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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 develop. The more you open, the more chances you'll have for conflicts, so don't get too carried away. 😄

@BraedonKlock

Copy link
Copy Markdown
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

missing null SLE check in directory iteration callbacks

2 participants