Skip to content

Commit a5d5fcf

Browse files
Fix code scanning alert no. 3: Incorrect conversion between integer types
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: pk910 <github@pk910.de>
1 parent 9977f62 commit a5d5fcf

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

  • pkg/coordinator/web/handlers

pkg/coordinator/web/handlers/logs.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,13 @@ func (fh *FrontendHandler) LogsData(w http.ResponseWriter, r *http.Request) {
3434

3535
vars := mux.Vars(r)
3636

37-
sinceTime, err := strconv.ParseInt(vars["since"], 10, 64)
37+
sinceTime, err := strconv.ParseInt(vars["since"], 10, 32)
3838
if err != nil {
3939
fmt.Printf("err: %v", err)
4040

4141
sinceTime = 0
4242
}
4343

44-
// Check bounds before converting to int
45-
if sinceTime < math.MinInt32 || sinceTime > math.MaxInt32 {
46-
fmt.Printf("timestamp out of int bounds: %v", sinceTime)
47-
sinceTime = 0
48-
}
49-
5044
pageData := fh.getLogsPageData(sinceTime)
5145

5246
w.Header().Set("Content-Type", "application/json")

0 commit comments

Comments
 (0)