ugorji / go

idiomatic codec and rpc lib for msgpack, cbor, json, etc. msgpack.org[Go]
MIT License
1.86k stars 295 forks source link

CBOR: Reject malformed and invalid indefinite-length strings #405

Closed benluddy closed 1 year ago

benluddy commented 1 year ago

Tests and potential fix for https://github.com/ugorji/go/issues/403 and https://github.com/ugorji/go/issues/404.

Makes decode return a error if a byte string is nested within an indefinite-length text string, or a text string is nested within an indefinite-length byte string. Separately, if the decode option ValidateUnicode is enabled, it will also apply to text strings that are nested within an indefinite-length text string.