server: validate labels size to avoid dos

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2017-11-11 12:00:48 +01:00
parent befd719812
commit 33f699bad4
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
3 changed files with 22 additions and 0 deletions

View file

@ -224,6 +224,10 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
// add labels
labels := req.GetConfig().GetLabels()
if err := validateLabels(labels); err != nil {
return nil, err
}
// Add special container name label for the infra container
labelsJSON := []byte{}
if labels != nil {