Skip to content

markers: reject a decoded mark payload with no type marks - #169

Open
arpitjain099 wants to merge 1 commit into
cockroachdb:masterfrom
arpitjain099:fix/decode-mark-empty-types
Open

arpitjain099 wants to merge 1 commit into
cockroachdb:masterfrom
arpitjain099:fix/decode-mark-empty-types

Conversation

@arpitjain099

@arpitjain099 arpitjain099 commented Nov 4, 2026 •

Copy link
Copy Markdown

decodeMark checks that the wire payload has the right Go type and nothing else. A peer that sends a MarkPayload with no type marks therefore decodes fine, and SafeFormatError then reads types[0], so printing the result with %+v returns a PANIC marker where the error text should be.

The decoders that index into their payload all check the length first: decodePathError, decodeLinkError, decodeWithDomain, decodeWithIssueLink. This widens the existing guard the same way, so DecodeError falls back to the opaque type. The test builds the payload by hand because the local encoder always writes at least one mark. go test -race ./... passes.


This change is Reviewable

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@cockroachlabs-cla-agent

cockroachlabs-cla-agent Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@huzhao37

huzhao37 commented Nov 4, 2026 via email

Copy link
Copy Markdown

@arpitjain099

Copy link
Copy Markdown
Author

@huzhao37 CLA signed

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