Skip to content

Commit 3087d43

Browse files
author
Mrunal Patel
authored
Merge pull request #1826 from jingxiaolu/fix_specconv_process_nil
specconv: fix null spec.Process making runc panic
2 parents 07bd280 + 62cfad9 commit 3087d43

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

libcontainer/specconv/spec_linux_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,3 +585,16 @@ func TestInitSystemdProps(t *testing.T) {
585585
}
586586
}
587587
}
588+
589+
func TestNullProcess(t *testing.T) {
590+
spec := Example()
591+
spec.Process = nil
592+
593+
_, err := CreateLibcontainerConfig(&CreateOpts{
594+
Spec: spec,
595+
})
596+
597+
if err != nil {
598+
t.Errorf("Null process should be forbidden")
599+
}
600+
}

0 commit comments

Comments
 (0)