fix(specgen): index out of range when unmask=[]

Fixes #18848

Signed-off-by: xtexChooser <xtexchooser@duck.com>
This commit is contained in:
xtexChooser
2023-06-11 08:50:04 +08:00
parent 6856c7717d
commit 53834ef0dc

View File

@ -57,7 +57,7 @@ func getCgroupPermissions(unmask []string) string {
return ro
}
if unmask != nil && unmask[0] == "ALL" {
if unmask != nil && len(unmask) != 0 && unmask[0] == "ALL" {
return rw
}