Skip to content

make write_text_sz leave no partial output in the buffer on error#30

Merged
NicolasDP merged 1 commit into
primetype:masterfrom
dcSpark:fix-partial-write
Jul 8, 2026
Merged

make write_text_sz leave no partial output in the buffer on error#30
NicolasDP merged 1 commit into
primetype:masterfrom
dcSpark:fix-partial-write

Conversation

@SebastienGllmt

Copy link
Copy Markdown
Contributor

Serializer::write_text_sz with StringLenSz::Indefinite writes incrementally into self.data, which means if a caller catches the error and keeps trying to use the serializer, it produces corrupt CBOR

The fix is to instead validate the write length (and fail if invalid) before actually writing

@NicolasDP NicolasDP merged commit 7ce47e3 into primetype:master Jul 8, 2026
16 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