1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

[Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670)

* Update go-swagger

* vendor
This commit is contained in:
6543
2020-09-01 16:01:23 +02:00
committed by GitHub
parent 66843f2237
commit 3270e7a443
350 changed files with 26353 additions and 5552 deletions

View File

@@ -14,7 +14,6 @@ import (
"io"
"math"
"sync"
"unicode"
"go.mongodb.org/mongo-driver/bson/bsontype"
"go.mongodb.org/mongo-driver/bson/primitive"
@@ -373,7 +372,8 @@ func (vr *valueReader) ReadBinary() (b []byte, btype byte, err error) {
return nil, 0, err
}
if btype == 0x02 {
// Check length in case it is an old binary without a length.
if btype == 0x02 && length > 4 {
length, err = vr.readLength()
if err != nil {
return nil, 0, err
@@ -449,6 +449,9 @@ func (vr *valueReader) ReadCodeWithScope() (code string, dr DocumentReader, err
if err != nil {
return "", nil, err
}
if strLength <= 0 {
return "", nil, fmt.Errorf("invalid string length: %d", strLength)
}
strBytes, err := vr.readBytes(strLength)
if err != nil {
return "", nil, err
@@ -817,14 +820,6 @@ func (vr *valueReader) readString() (string, error) {
start := vr.offset
vr.offset += int64(length)
if length == 2 {
asciiByte := vr.d[start]
if asciiByte > unicode.MaxASCII {
return "", fmt.Errorf("invalid ascii byte")
}
}
return string(vr.d[start : start+int64(length)-1]), nil
}