Repository navigation
markers: reject a decoded mark payload with no type marks - #169
Open
arpitjain099 wants to merge 1 commit into
Open
arpitjain099 wants to merge 1 commit into
arpitjain099 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
|
这是一封自动回复邮件。已经收到您的来信,我会尽快回复。
|
Author
|
@huzhao37 CLA signed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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