Skip to content

add defensive check for sfData length#6449

Open
mvadari wants to merge 1 commit intoXRPLF:ripple/smart-escrowfrom
mvadari:backup-check-length
Open

add defensive check for sfData length#6449
mvadari wants to merge 1 commit intoXRPLF:ripple/smart-escrowfrom
mvadari:backup-check-length

Conversation

@mvadari
Copy link
Collaborator

@mvadari mvadari commented Feb 27, 2026

High Level Overview of Change

Title says it all

Context of Change

Going through AI review of the PR

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

API Impact

N/A

Test Plan

CI passes

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a defensive guard in EscrowFinish::doApply() to ensure any WASM-produced sfData does not exceed the protocol’s maximum allowed length before writing it into the Escrow ledger entry.

Changes:

  • Add a size check for ledgerDataProvider->getData() against maxWasmDataLength prior to setFieldVL(sfData, ...).
  • Return tecINTERNAL on the (expected-unreachable) oversized-data condition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.5%. Comparing base (446ad36) to head (b0d94a6).

Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                  @@
##           ripple/smart-escrow   #6449     +/-   ##
=====================================================
- Coverage                 80.5%   80.5%   -0.0%     
=====================================================
  Files                      855     855             
  Lines                    67809   67810      +1     
  Branches                  7268    7274      +6     
=====================================================
- Hits                     54618   54608     -10     
- Misses                   13191   13202     +11     
Files with missing lines Coverage Δ
src/xrpld/app/tx/detail/Escrow.cpp 99.3% <100.0%> (+<0.1%) ⬆️

... and 7 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants