Skip to content

Don't allocate bytes for invalid sizes#801

Merged
t-bast merged 1 commit intomasterfrom
reject-invalid-offer-tlvs
Jul 29, 2025
Merged

Don't allocate bytes for invalid sizes#801
t-bast merged 1 commit intomasterfrom
reject-invalid-offer-tlvs

Conversation

@t-bast
Copy link
Copy Markdown
Member

@t-bast t-bast commented Jul 29, 2025

In our bytes codec, we allocate a byte array before checking that it doesn't exceed the remaining number of bytes in the stream. This is dumb, we should first validate the size before allocating memory.

Thanks @erickcestari for reporting this.

In our `bytes` codec, we allocate a byte array before checking that
it doesn't exceed the remaining number of bytes in the stream. This
is dumb, we should first validate the size before allocating memory.

Thanks @erickcestari for reporting this.
@t-bast t-bast requested review from sstone and thomash-acinq July 29, 2025 16:48
@t-bast t-bast merged commit a6904c2 into master Jul 29, 2025
2 checks passed
@t-bast t-bast deleted the reject-invalid-offer-tlvs branch July 29, 2025 17:33
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