diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-05-06 06:24:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-06 06:24:19 -0400 |
commit | 0b05ba808d5e2fc75ce10b23405bd5c05da2c331 (patch) | |
tree | 7c489ea3aa926cda031d6aaa4a852e9e6e469d14 /vendor/google.golang.org/protobuf/internal/impl/decode.go | |
parent | 9b9bd9e0e7b72c91d8e60103e8da7999cefbc63d (diff) | |
parent | 3de369fd696e6b98d00259d3c759d9b81df4e84b (diff) | |
download | podman-0b05ba808d5e2fc75ce10b23405bd5c05da2c331.tar.gz podman-0b05ba808d5e2fc75ce10b23405bd5c05da2c331.tar.bz2 podman-0b05ba808d5e2fc75ce10b23405bd5c05da2c331.zip |
Merge pull request #10241 from containers/dependabot/go_modules/github.com/onsi/gomega-1.12.0
Bump github.com/onsi/gomega from 1.11.0 to 1.12.0
Diffstat (limited to 'vendor/google.golang.org/protobuf/internal/impl/decode.go')
-rw-r--r-- | vendor/google.golang.org/protobuf/internal/impl/decode.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/vendor/google.golang.org/protobuf/internal/impl/decode.go b/vendor/google.golang.org/protobuf/internal/impl/decode.go index 85ba1d3b3..949dc49a6 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/decode.go +++ b/vendor/google.golang.org/protobuf/internal/impl/decode.go @@ -17,6 +17,8 @@ import ( piface "google.golang.org/protobuf/runtime/protoiface" ) +var errDecode = errors.New("cannot parse invalid wire-format data") + type unmarshalOptions struct { flags protoiface.UnmarshalInputFlags resolver interface { @@ -100,13 +102,13 @@ func (mi *MessageInfo) unmarshalPointer(b []byte, p pointer, groupTag protowire. var n int tag, n = protowire.ConsumeVarint(b) if n < 0 { - return out, protowire.ParseError(n) + return out, errDecode } b = b[n:] } var num protowire.Number if n := tag >> 3; n < uint64(protowire.MinValidNumber) || n > uint64(protowire.MaxValidNumber) { - return out, errors.New("invalid field number") + return out, errDecode } else { num = protowire.Number(n) } @@ -114,7 +116,7 @@ func (mi *MessageInfo) unmarshalPointer(b []byte, p pointer, groupTag protowire. if wtyp == protowire.EndGroupType { if num != groupTag { - return out, errors.New("mismatching end group marker") + return out, errDecode } groupTag = 0 break @@ -170,10 +172,10 @@ func (mi *MessageInfo) unmarshalPointer(b []byte, p pointer, groupTag protowire. } n = protowire.ConsumeFieldValue(num, wtyp, b) if n < 0 { - return out, protowire.ParseError(n) + return out, errDecode } if !opts.DiscardUnknown() && mi.unknownOffset.IsValid() { - u := p.Apply(mi.unknownOffset).Bytes() + u := mi.mutableUnknownBytes(p) *u = protowire.AppendTag(*u, num, wtyp) *u = append(*u, b[:n]...) } @@ -181,7 +183,7 @@ func (mi *MessageInfo) unmarshalPointer(b []byte, p pointer, groupTag protowire. b = b[n:] } if groupTag != 0 { - return out, errors.New("missing end group marker") + return out, errDecode } if mi.numRequiredFields > 0 && bits.OnesCount64(requiredMask) != int(mi.numRequiredFields) { initialized = false @@ -221,7 +223,7 @@ func (mi *MessageInfo) unmarshalExtension(b []byte, num protowire.Number, wtyp p return out, nil } case ValidationInvalid: - return out, errors.New("invalid wire format") + return out, errDecode case ValidationUnknown: } } |