Skip to content

Commit e326a2f

Browse files
committed
prevent integer overflow
1 parent 0b635b9 commit e326a2f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dbos/conductor.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,10 @@ func (c *Conductor) handleForkWorkflowRequest(data []byte, requestID string) err
876876
if req.Body.StartStep < 0 {
877877
return fmt.Errorf("invalid StartStep: cannot be negative")
878878
}
879+
// Additional validation to prevent integer overflow when converting to uint
880+
if req.Body.StartStep > math.MaxInt {
881+
return fmt.Errorf("invalid StartStep: value too large")
882+
}
879883
input := ForkWorkflowInput{
880884
OriginalWorkflowID: req.Body.WorkflowID,
881885
StartStep: uint(req.Body.StartStep),

0 commit comments

Comments
 (0)