Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ledger_entry crash on invalid request #5189

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

Bronek
Copy link
Collaborator

@Bronek Bronek commented Nov 12, 2024

High Level Overview of Change

RPC ledger_entry is not performing sufficient checks on input for deposit_preauth, which causes a crash.

Context of Change

In #5103 we have added support for authorized_credentials array to deposit_preauth objects for the ledger_entry RCP request. The checks for the correct inputs in this authorized_credentials array were not exhaustive enough. This PR is fixing it, alongside with fixing the unit tests to improve the coverage.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

@Bronek Bronek added this to the 2.3.0 (Nov 2024) milestone Nov 12, 2024
@Bronek Bronek added Bug Perf impact not expected Change is not expected to improve nor harm performance. labels Nov 12, 2024
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.9%. Comparing base (9d58f11) to head (cba54a0).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5189     +/-   ##
=========================================
- Coverage     77.9%   77.9%   -0.1%     
=========================================
  Files          782     782             
  Lines        66616   66619      +3     
  Branches      8161    8158      -3     
=========================================
- Hits         51902   51870     -32     
- Misses       14714   14749     +35     
Files with missing lines Coverage Δ
src/xrpld/rpc/handlers/LedgerEntry.cpp 79.8% <100.0%> (+0.2%) ⬆️

... and 11 files with indirect coverage changes

Impacted file tree graph

@Bronek Bronek added the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label Nov 12, 2024
@ximinez ximinez merged commit 2316d84 into develop Nov 12, 2024
22 checks passed
@ximinez ximinez deleted the bugfix/preauth_credentials_crash branch November 12, 2024 23:25
@ximinez ximinez mentioned this pull request Nov 12, 2024
3 tasks
vlntb pushed a commit to vlntb/rippled that referenced this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. Perf impact not expected Change is not expected to improve nor harm performance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants