diff options
author | 2023-02-25 13:12:40 +0100 | |
---|---|---|
committer | 2023-02-25 12:12:40 +0000 | |
commit | ecdc8379fa8f9d88faca626e7de748c2afbe4910 (patch) | |
tree | 8c20a5826db2136fc89bee45e15355c5899fa65b /vendor/github.com/ugorji/go/codec/cbor.go | |
parent | [bugfix] Fix deleted status causing issues when getting bookmark (#1551) (diff) | |
download | gotosocial-ecdc8379fa8f9d88faca626e7de748c2afbe4910.tar.xz |
[chore] Update gin to v1.9.0 (#1553)
Diffstat (limited to 'vendor/github.com/ugorji/go/codec/cbor.go')
-rw-r--r-- | vendor/github.com/ugorji/go/codec/cbor.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/github.com/ugorji/go/codec/cbor.go b/vendor/github.com/ugorji/go/codec/cbor.go index 45eb822b9..10944487e 100644 --- a/vendor/github.com/ugorji/go/codec/cbor.go +++ b/vendor/github.com/ugorji/go/codec/cbor.go @@ -7,6 +7,7 @@ import ( "math" "reflect" "time" + "unicode/utf8" ) // major @@ -629,7 +630,11 @@ func (d *cborDecDriver) DecodeBytes(bs []byte) (bsOut []byte) { } func (d *cborDecDriver) DecodeStringAsBytes() (s []byte) { - return d.DecodeBytes(nil) + s = d.DecodeBytes(nil) + if d.h.ValidateUnicode && !utf8.Valid(s) { + d.d.errorf("DecodeStringAsBytes: invalid UTF-8: %s", s) + } + return } func (d *cborDecDriver) DecodeTime() (t time.Time) { |