Skip to content

Commit

Permalink
controller security_group: Fix index out of range problem
Browse files Browse the repository at this point in the history
Signed-off-by: zhuanlan <zhuanlan_yewu@cmss.chinamobile.com>
  • Loading branch information
Longchuanzheng authored and bobz965 committed Mar 29, 2024
1 parent 8d17662 commit 27f6629
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (c *Controller) updateDenyAllSgPorts() error {
addPorts := make([]string, 0, len(lsps))
for _, lsp := range lsps {
// skip lsp which only have mac addresses,address is in port.PortSecurity[0]
if len(strings.Split(lsp.PortSecurity[0], " ")) < 2 {
if len(lsp.PortSecurity) == 0 || len(strings.Split(lsp.PortSecurity[0], " ")) < 2 {
continue
}

Expand Down

0 comments on commit 27f6629

Please sign in to comment.