Skip to content

Commit

Permalink
Fix nil pointer dereference in ctrl.DisabledReason
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Oct 2, 2024
1 parent 9f8fbc1 commit f4713a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sechub/sechub.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,11 @@ func ctrls(ctx context.Context, c *securityhub.Client, subscriptionArn *string)
case types.ControlStatusEnabled:
cs.Enable = append(cs.Enable, *ctrl.ControlId)
case types.ControlStatusDisabled:
cs.Disable = append(cs.Disable, yaml.MapItem{Key: *ctrl.ControlId, Value: *ctrl.DisabledReason})
reason := "No reason"
if ctrl.DisabledReason != nil {
reason = *ctrl.DisabledReason
}
cs.Disable = append(cs.Disable, yaml.MapItem{Key: *ctrl.ControlId, Value: reason})
}
}
nt = ctrls.NextToken
Expand Down

0 comments on commit f4713a7

Please sign in to comment.