Skip to content

fix: moov-io/bertlv update to fix tlv panic error - #3

Merged
bosbaber merged 1 commit into
mainfrom
stephan/hsm-54
Oct 26, 2026
Merged

bosbaber merged 1 commit into
mainfrom
stephan/hsm-54

Conversation

@bosbaber

Copy link
Copy Markdown
Contributor

This pull request updates dependencies and adds new tests to improve the robustness of the tlv.ValidateAmount function. The main focus is to ensure that malformed or random TLV payloads do not cause panics, addressing issues with previous versions of the bertlv library.

Dependency updates:

  • Upgraded github.com/moov-io/bertlv from v0.1.0 to a newer pre-release version to fix panics on malformed input.
  • Updated github.com/stretchr/testify to v1.12.1 and added go.yaml.in/yaml/v3 as an indirect dependency.

Testing improvements:

  • Added test cases (TestValidateAmountDoesNotPanicOnMalformedLength, TestValidateAmountDoesNotPanicOnRandomPayloads, and FuzzValidateAmount) to verify that malformed or random TLV payloads do not cause panics and always return a parsing error.
  • Imported the new math/rand/v2 package to support randomized testing.

@bosbaber bosbaber self-assigned this Oct 26, 2026

@koekiebox koekiebox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

@bosbaber
bosbaber merged commit 232484b into main Oct 26, 2026
2 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.

2 participants