Skip to content

Commit

Permalink
fix(task_scheduler): possible int overflow, casting int32/64 to uint1…
Browse files Browse the repository at this point in the history
…6. (#112)
  • Loading branch information
kehiy authored Jan 19, 2025
1 parent f082931 commit d0a31fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion delivery/websocket/task_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ func (s *Server) checkExpiration() { //nolint
continue
}

kind, err := strconv.Atoi(data[1])
kind, err := strconv.ParseUint(data[1], 10, 16)
if err != nil {
continue
}

// lint error is g115 gosec rule. this rule is broken.
// see: https://github.com/securego/gosec/issues/1288
if err := s.handler.DeleteByID(data[0],
types.Kind(kind)); err != nil { //nolint
failedTasks = append(failedTasks, task)
Expand Down

0 comments on commit d0a31fa

Please sign in to comment.