diff --git a/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go b/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go index f89ca163cd3..3e0cdb10d40 100644 --- a/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go +++ b/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go @@ -166,7 +166,7 @@ func (m *Quantity) Unmarshal(data []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenerated } if (iNdEx + skippy) > l {