Skip to content

fix: reject trailing bytes in fromXdrBase64 and fromXdrByteArray. - #842

Merged
overcat merged 1 commit into
masterfrom
fix/xdr-trailing-bytes
Nov 16, 2026
Merged

overcat merged 1 commit into
masterfrom
fix/xdr-trailing-bytes

Conversation

@overcat

@overcat overcat commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

They decode one value and now throw IOException when input is left after it, as stellar-core and the other SDKs do, so different strings can't decode to the same value. The streaming decode(XdrDataInputStream) is unchanged and still reads one value at a time.

Closes #833

Ref #835

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.69%. Comparing base (ea31abb) to head (dcaec3a).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #842      +/-   ##
============================================
+ Coverage     83.56%   83.69%   +0.12%     
- Complexity     1737     1738       +1     
============================================
  Files           234      234              
  Lines          6242     6242              
  Branches        714      714              
============================================
+ Hits           5216     5224       +8     
+ Misses          635      627       -8     
  Partials        391      391              

see 4 files with indirect coverage changes

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

They decode one value and now throw IOException when input is left after it,
as stellar-core and the other SDKs do, so different strings can't decode to
the same value. The streaming decode(XdrDataInputStream) is unchanged and
still reads one value at a time.
@overcat
overcat force-pushed the fix/xdr-trailing-bytes branch from c08ed2b to dcaec3a Compare November 16, 2026 12:52
@overcat
overcat enabled auto-merge (squash) November 16, 2026 13:02
@overcat
overcat disabled auto-merge November 16, 2026 13:03
@overcat
overcat merged commit d093810 into master Nov 16, 2026
12 checks passed
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.

XDR decoding accepts trailing bytes: fromXdrBase64 / fromXdrByteArray do not check that the input is fully consumed

1 participant