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/msgpack.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/msgpack.go')
-rw-r--r-- | vendor/github.com/ugorji/go/codec/msgpack.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vendor/github.com/ugorji/go/codec/msgpack.go b/vendor/github.com/ugorji/go/codec/msgpack.go index dc25530e7..c8b539d4e 100644 --- a/vendor/github.com/ugorji/go/codec/msgpack.go +++ b/vendor/github.com/ugorji/go/codec/msgpack.go @@ -24,6 +24,7 @@ import ( "net/rpc" "reflect" "time" + "unicode/utf8" ) const ( @@ -872,7 +873,11 @@ func (d *msgpackDecDriver) DecodeBytes(bs []byte) (bsOut []byte) { } func (d *msgpackDecDriver) 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 *msgpackDecDriver) descBd() string { @@ -1071,7 +1076,7 @@ func (d *msgpackDecDriver) decodeExtV(verifyTag bool, tag byte) (xbs []byte, xta //-------------------------------------------------- -//MsgpackHandle is a Handle for the Msgpack Schema-Free Encoding Format. +// MsgpackHandle is a Handle for the Msgpack Schema-Free Encoding Format. type MsgpackHandle struct { binaryEncodingType BasicHandle |