From 847e7c7c3a1f18eda13004eca64d2606bde54d33 Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Sun, 4 Dec 2022 14:20:41 +0100 Subject: [chore] Fix a few possible cases of int truncation (#1207) This fixes a couple of cases where due to int being platform dependent a value could get truncated if running on 32bits. --- internal/api/client/search/searchget.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/api/client/search') diff --git a/internal/api/client/search/searchget.go b/internal/api/client/search/searchget.go index b3da2640d..7026213ac 100644 --- a/internal/api/client/search/searchget.go +++ b/internal/api/client/search/searchget.go @@ -109,7 +109,7 @@ func (m *Module) SearchGETHandler(c *gin.Context) { limit := 2 limitString := c.Query(LimitKey) if limitString != "" { - i, err := strconv.ParseInt(limitString, 10, 64) + i, err := strconv.ParseInt(limitString, 10, 32) if err != nil { err := fmt.Errorf("error parsing %s: %s", LimitKey, err) api.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGet) @@ -127,7 +127,7 @@ func (m *Module) SearchGETHandler(c *gin.Context) { offset := 0 offsetString := c.Query(OffsetKey) if offsetString != "" { - i, err := strconv.ParseInt(offsetString, 10, 64) + i, err := strconv.ParseInt(offsetString, 10, 32) if err != nil { err := fmt.Errorf("error parsing %s: %s", OffsetKey, err) api.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGet) -- cgit v1.2.3