diff --git a/cmd/stdiscosrv/database.pb.go b/cmd/stdiscosrv/database.pb.go index 534d22f34..c81d319c7 100644 --- a/cmd/stdiscosrv/database.pb.go +++ b/cmd/stdiscosrv/database.pb.go @@ -773,6 +773,7 @@ func (m *DatabaseAddress) Unmarshal(dAtA []byte) error { func skipDatabase(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -804,10 +805,8 @@ func skipDatabase(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -828,55 +827,30 @@ func skipDatabase(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthDatabase } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthDatabase - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDatabase - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipDatabase(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthDatabase - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDatabase + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthDatabase + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthDatabase = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDatabase = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthDatabase = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDatabase = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDatabase = fmt.Errorf("proto: unexpected end of group") ) diff --git a/go.mod b/go.mod index 26cad7ba0..6a2009c91 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/getsentry/raven-go v0.2.0 github.com/go-ole/go-ole v1.2.4 // indirect github.com/gobwas/glob v0.2.3 - github.com/gogo/protobuf v1.3.0 + github.com/gogo/protobuf v1.3.1 github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 github.com/golang/mock v1.3.1 // indirect github.com/jackpal/gateway v1.0.5 diff --git a/go.sum b/go.sum index 94724d342..90499f59e 100644 --- a/go.sum +++ b/go.sum @@ -55,6 +55,8 @@ github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJA github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.0 h1:G8O7TerXerS4F6sx9OV7/nRfJdnXgHZu/S/7F2SN+UE= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk= diff --git a/lib/db/structs.pb.go b/lib/db/structs.pb.go index f52111a4b..c8f07a9ab 100644 --- a/lib/db/structs.pb.go +++ b/lib/db/structs.pb.go @@ -1712,6 +1712,7 @@ func (m *CountsSet) Unmarshal(dAtA []byte) error { func skipStructs(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1743,10 +1744,8 @@ func skipStructs(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1767,55 +1766,30 @@ func skipStructs(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthStructs } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthStructs - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStructs - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipStructs(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthStructs - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStructs + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthStructs + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthStructs = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStructs = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthStructs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStructs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStructs = fmt.Errorf("proto: unexpected end of group") ) diff --git a/lib/discover/local.pb.go b/lib/discover/local.pb.go index ad5060d6e..7e18c6957 100644 --- a/lib/discover/local.pb.go +++ b/lib/discover/local.pb.go @@ -313,6 +313,7 @@ func (m *Announce) Unmarshal(dAtA []byte) error { func skipLocal(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -344,10 +345,8 @@ func skipLocal(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -368,55 +367,30 @@ func skipLocal(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthLocal } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthLocal - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLocal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipLocal(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthLocal - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLocal + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthLocal + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthLocal = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowLocal = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthLocal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLocal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLocal = fmt.Errorf("proto: unexpected end of group") ) diff --git a/lib/protocol/bep.pb.go b/lib/protocol/bep.pb.go index 255ae74d1..c177b4d52 100644 --- a/lib/protocol/bep.pb.go +++ b/lib/protocol/bep.pb.go @@ -5045,6 +5045,7 @@ func (m *Close) Unmarshal(dAtA []byte) error { func skipBep(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -5076,10 +5077,8 @@ func skipBep(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -5100,55 +5099,30 @@ func skipBep(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthBep } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthBep - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBep - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipBep(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthBep - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBep + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthBep + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthBep = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBep = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthBep = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBep = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBep = fmt.Errorf("proto: unexpected end of group") ) diff --git a/lib/protocol/deviceid_test.pb.go b/lib/protocol/deviceid_test.pb.go index 975da5aaf..cc29c7b7d 100644 --- a/lib/protocol/deviceid_test.pb.go +++ b/lib/protocol/deviceid_test.pb.go @@ -400,6 +400,7 @@ func (m *TestNewDeviceID) Unmarshal(dAtA []byte) error { func skipDeviceidTest(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -431,10 +432,8 @@ func skipDeviceidTest(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -455,55 +454,30 @@ func skipDeviceidTest(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthDeviceidTest } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthDeviceidTest - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDeviceidTest - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipDeviceidTest(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthDeviceidTest - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDeviceidTest + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthDeviceidTest + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthDeviceidTest = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDeviceidTest = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthDeviceidTest = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDeviceidTest = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDeviceidTest = fmt.Errorf("proto: unexpected end of group") )