updated dependencies

This commit is contained in:
ston1th 2020-06-25 15:34:32 +02:00
commit d45fa68a90
703 changed files with 93434 additions and 103138 deletions

View file

@ -474,8 +474,8 @@ func AppendExtension(b []byte, e Extension) ([]byte, error) {
// and returns any remaining bytes.
// Possible errors:
// - ErrShortBytes ('b' not long enough)
// - ExtensionTypeErorr{} (wire type not the same as e.Type())
// - TypeErorr{} (next object not an extension)
// - ExtensionTypeError{} (wire type not the same as e.Type())
// - TypeError{} (next object not an extension)
// - InvalidPrefixError
// - An umarshal error returned from e.UnmarshalBinary
func ReadExtensionBytes(b []byte, e Extension) ([]byte, error) {

View file

@ -466,7 +466,23 @@ func rwquoted(dst jsWriter, s []byte) (n int, err error) {
return
}
n++
case '\t':
err = dst.WriteByte('\\')
if err != nil {
return
}
n++
err = dst.WriteByte('t')
if err != nil {
return
}
n++
default:
// This encodes bytes < 0x20 except for \t, \n and \r.
// It also escapes <, >, and &
// because they can lead to security holes when
// user-controlled strings are rendered into JSON
// and served to some browsers.
nn, err = dst.WriteString(`\u00`)
n += nn
if err != nil {
@ -495,16 +511,23 @@ func rwquoted(dst jsWriter, s []byte) (n int, err error) {
if err != nil {
return
}
nn, err = dst.WriteString(`\ufffd`)
n += nn
if err != nil {
return
}
i += size
start = i
continue
}
nn, err = dst.WriteString(`\ufffd`)
n += nn
if err != nil {
return
}
i += size
start = i
continue
}
// U+2028 is LINE SEPARATOR.
// U+2029 is PARAGRAPH SEPARATOR.
// They are both technically valid characters in JSON strings,
// but don't work in JSONP, which has to be evaluated as JavaScript,
// and can lead to security holes there. It is valid JSON to
// escape them, so we do so unconditionally.
// See http://timelessrepo.com/json-isnt-a-javascript-subset for discussion.
if c == '\u2028' || c == '\u2029' {
if start < i {
nn, err = dst.Write(s[start:i])
@ -512,17 +535,20 @@ func rwquoted(dst jsWriter, s []byte) (n int, err error) {
if err != nil {
return
}
nn, err = dst.WriteString(`\u202`)
n += nn
if err != nil {
return
}
err = dst.WriteByte(hex[c&0xF])
if err != nil {
return
}
n++
}
nn, err = dst.WriteString(`\u202`)
n += nn
if err != nil {
return
}
err = dst.WriteByte(hex[c&0xF])
if err != nil {
return
}
n++
i += size
start = i
continue
}
i += size
}

View file

@ -201,14 +201,14 @@ func ReadMapHeaderBytes(b []byte) (sz uint32, o []byte, err error) {
// - ErrShortBytes (too few bytes)
// - TypeError{} (not a str or bin)
func ReadMapKeyZC(b []byte) ([]byte, []byte, error) {
o, b, err := ReadStringZC(b)
o, x, err := ReadStringZC(b)
if err != nil {
if tperr, ok := err.(TypeError); ok && tperr.Encoded == BinType {
return ReadBytesZC(b)
}
return nil, b, err
}
return o, b, nil
return o, x, nil
}
// ReadArrayHeaderBytes attempts to read