Skip to content

Commit d259596

Browse files
Potential fix for pull request finding 'CodeQL / Incorrect conversion between integer types'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 8566836 commit d259596

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • cmd/zoekt-sourcegraph-indexserver

cmd/zoekt-sourcegraph-indexserver/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,13 +906,13 @@ func (s *Server) handleReindex(w http.ResponseWriter, r *http.Request) {
906906
return
907907
}
908908

909-
id, err := strconv.Atoi(r.Form.Get("repo"))
909+
repoID, err := strconv.ParseUint(r.Form.Get("repo"), 10, 32)
910910
if err != nil {
911911
http.Error(w, err.Error(), http.StatusBadRequest)
912912
return
913913
}
914914

915-
go func() { s.forceIndex(r.Context(), uint32(id)) }()
915+
go func() { s.forceIndex(r.Context(), uint32(repoID)) }()
916916

917917
// 202 Accepted
918918
w.WriteHeader(http.StatusAccepted)

0 commit comments

Comments
 (0)