Merge pull request #777 from cyphar/fix-null-pointer-deref

libcontainer: specconv: fix nil dereference in resource setup
This commit is contained in:
Mrunal Patel 2016-04-24 19:09:30 -07:00
commit 091ed0b043
1 changed files with 2 additions and 2 deletions

View File

@ -222,8 +222,8 @@ func CreateLibcontainerConfig(opts *CreateOpts) (*configs.Config, error) {
config.ProcessLabel = spec.Process.SelinuxLabel
}
config.Sysctl = spec.Linux.Sysctl
if oomScoreAdj := spec.Linux.Resources.OOMScoreAdj; oomScoreAdj != nil {
config.OomScoreAdj = *oomScoreAdj
if spec.Linux.Resources != nil && spec.Linux.Resources.OOMScoreAdj != nil {
config.OomScoreAdj = *spec.Linux.Resources.OOMScoreAdj
}
for _, g := range spec.Process.User.AdditionalGids {
config.AdditionalGroups = append(config.AdditionalGroups, strconv.FormatUint(uint64(g), 10))