Skip to content

Commit

Permalink
IWF-158: Testing nil pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
stevo89519 committed Oct 1, 2024
1 parent a6ccde1 commit f3de62a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions integ/interstate_workflow_state1.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ func (b interStateWorkflowState1) Execute(ctx iwf.WorkflowContext, input iwf.Obj
panic("nil cmd1")
}

if &cmd1.Status == nil {
panic("nil cmd1 Status")
if iwfidl.WAITING == iwfidl.RECEIVED {
panic("enum error")
}

if &cmd1.Status == iwfidl.WAITING && i == 2 {
if cmd1.Status == iwfidl.RECEIVED {
panic("cmd1 Status error")
}

if cmd1.Status == iwfidl.WAITING && i == 2 {
return iwf.GracefulCompletingWorkflow, nil
}
return nil, fmt.Errorf("error in executing " + ctx.GetStateExecutionId())
Expand Down

0 comments on commit f3de62a

Please sign in to comment.