validateProcessSpec: prevent SEGV when config is valid json, but invalid.

Signed-off-by: John Hwang <John.F.Hwang@gmail.com>
This commit is contained in:
John Hwang 2020-05-15 16:37:26 -07:00
parent 7fc291fd45
commit 5aa0601a59
1 changed files with 3 additions and 0 deletions

View File

@ -378,6 +378,9 @@ func (r *runner) checkTerminal(config *specs.Process) error {
}
func validateProcessSpec(spec *specs.Process) error {
if spec == nil {
return errors.New("process property must not be empty")
}
if spec.Cwd == "" {
return errors.New("Cwd property must not be empty")
}