Closed fxamacker closed 8 months ago
@fxamacker If you haven't already started on this one, I'm happy to pick it up. Just let me know!
@fxamacker If you haven't already started on this one, I'm happy to pick it up. Just let me know!
@benluddy Thanks! That would be great! :+1: Now I'm glad I updated the fuzzer on Sunday rather than work on this. :smile:
Closed by #503
DefaultByteStringType
is a new decoding option that was recently added in v2.6.0.Setting decoding option
DefaultByteStringType
toreflect.TypeOf("")
causes unintended side effect of allowing CBOR byte string to be decoded intotime.Time
. Although decoding CBOR byte string intotime.Time
is a requested feature, it should not be allowed by a side effect.Specifically,
parse()
decodes CBOR byte string into Go string if decoding optionDefaultByteStringType
is set toreflect.TypeOf("")
.parseToTime()
converts decoded Go value fromparse()
totime.Time
, so CBOR byte string is decoded to Go string, which is then converted totime.Time
.This side effect is from implementation details and is not intended.
DefaultByteStringType
should be limited to its documented use.Thanks @benluddy for initial discussion about this at #497. :+1: