Skip to content

type-length-value: don't write the entry header when alloc fails - #209

Merged
joncinque merged 1 commit into
solana-program:mainfrom
Iamsohungrynow:fix/tlv-alloc-partial-write
Oct 27, 2026
Merged

joncinque merged 1 commit into
solana-program:mainfrom
Iamsohungrynow:fix/tlv-alloc-partial-write

Conversation

@Iamsohungrynow

Copy link
Copy Markdown
Contributor

TlvStateMut::alloc wrote the type and length before checking the value fits, so after an InvalidAccountData the buffer no longer unpacks and retrying the same alloc returns TypeAlreadyExists. it now checks first, like realloc_with_repetition already does

TlvStateMut::alloc wrote the type and length before checking that the value
fits, so after an InvalidAccountData the buffer no longer unpacked and
retrying the same alloc returned TypeAlreadyExists. It now checks first, like
realloc_with_repetition already does.

@joncinque joncinque 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.

Thanks

@joncinque
joncinque merged commit 8f51e38 into solana-program:main Oct 27, 2026
54 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