Port PR 803 to master branch - #804
Merged
Merged
Conversation
NOTE: This issue does not affect standard CBOR time data (RFC 8949 tag 0 or tag 1) because the decoder already skips those data items on error. Setting timeTag = DecTagRequired also avoids the issue. When decoding into time.Time from a CBOR byte string, map, or array and decoding fails with UnmarshalTypeError, the data item at the cursor is not skipped under these decoding options: - CBOR byte string, if byteStringToTime == ByteStringToTimeForbidden and timeTag != DecTagRequired - CBOR array and map, if timeTag != DecTagRequired Since the cursor is not advanced, a caller can encounter unrelated decoding errors or panic if they continue parsing the rest of the CBOR data. This commit resolves the issue by skipping the data item under the above conditions, making it consistent with the other options and data types when decoding to time.Time.
x448
approved these changes
Aug 18, 2026
x448
left a comment
Contributor
There was a problem hiding this comment.
LGTM and thanks for the same-day fix!
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.
Port PR #803 (from v2.9.3) to master branch.