Skip to content

Don't write extra value after some CBOR epoch timestamps#701

Merged
danielaparker merged 1 commit into
danielaparker:masterfrom
sandorzm:patch-2
Apr 30, 2026
Merged

Don't write extra value after some CBOR epoch timestamps#701
danielaparker merged 1 commit into
danielaparker:masterfrom
sandorzm:patch-2

Conversation

@sandorzm
Copy link
Copy Markdown
Contributor

Fix that epoch_milli- and epoch_nano-tagged integers serialized to too many values in CBOR:

  1. a CBOR semantic tag of 1 (expected),
  2. a float64 number of seconds since the epoch (expected), and then
  3. the integer number of milliseconds or nanoseconds (bad).

Only the semantic tag and float64 should be written; the trailing integer could wrongly be interpreted as the next key in a map or value in an array.

Thanks for your work on the library and your quick response to my last pull request.

Fix that `epoch_milli`- and `epoch_nano`-tagged integers serialized to too many values in CBOR: a CBOR semantic tag of 1 (expected), a float64 number of seconds since the epoch (expected), and then the integer number of milliseconds or nanoseconds (bad). Only the semantic tag and float64 should be written; the trailing integer could wrongly be interpreted as the next key in a map or value in an array.

Thanks for your work on the library and your quick response to my last PR.
@danielaparker danielaparker merged commit 6eae7fa into danielaparker:master Apr 30, 2026
37 checks passed
@danielaparker
Copy link
Copy Markdown
Owner

Thanks for the fix!

@sandorzm sandorzm deleted the patch-2 branch April 30, 2026 14:52
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