Skip to content

Commit

Permalink
validateProcessSpec: prevent SEGV when config is valid json, but inva…
Browse files Browse the repository at this point in the history
…lid.

Signed-off-by: John Hwang <[email protected]>
  • Loading branch information
JFHwang committed May 16, 2020
1 parent 3f1e886 commit e021f83
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ func (r *runner) checkTerminal(config *specs.Process) error {
}

func validateProcessSpec(spec *specs.Process) error {
if spec == nil {
return fmt.Errorf("process property must not be empty")
}
if spec.Cwd == "" {
return fmt.Errorf("Cwd property must not be empty")
}
Expand Down

0 comments on commit e021f83

Please sign in to comment.