diff --git a/go.mod b/go.mod index 364013c214f29..9cc38aac4084f 100644 --- a/go.mod +++ b/go.mod @@ -126,7 +126,7 @@ require ( github.com/efficientgo/core v1.0.0-rc.2 github.com/fsnotify/fsnotify v1.7.0 github.com/gogo/googleapis v1.4.0 - github.com/grafana/jsonparser v0.0.0-20240209175146-098958973a2d + github.com/grafana/jsonparser v0.0.0-20240425183733-ea80629e1a32 github.com/grafana/loki/pkg/push v0.0.0-20231124142027-e52380921608 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/hashicorp/raft v1.7.0 diff --git a/go.sum b/go.sum index 5c40b98f0cd52..a38449e4593d9 100644 --- a/go.sum +++ b/go.sum @@ -1043,8 +1043,8 @@ github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85 h1:xLuzPoOzdfNb/RF/I github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85/go.mod h1:crI9WX6p0IhrqB+DqIUHulRW853PaNFf7o4UprV//3I= github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56 h1:X8IKQ0wu40wpvYcKfBcc5T4QnhdQjUhtUtB/1CY89lE= github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU= -github.com/grafana/jsonparser v0.0.0-20240209175146-098958973a2d h1:YwbJJ/PrVWVdnR+j/EAVuazdeP+Za5qbiH1Vlr+wFXs= -github.com/grafana/jsonparser v0.0.0-20240209175146-098958973a2d/go.mod h1:796sq+UcONnSlzA3RtlBZ+b/hrerkZXiEmO8oMjyRwY= +github.com/grafana/jsonparser v0.0.0-20240425183733-ea80629e1a32 h1:NznuPwItog+rwdVg8hAuGKP29ndRSzJAwhxKldkP8oQ= +github.com/grafana/jsonparser v0.0.0-20240425183733-ea80629e1a32/go.mod h1:796sq+UcONnSlzA3RtlBZ+b/hrerkZXiEmO8oMjyRwY= github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe h1:yIXAAbLswn7VNWBIvM71O2QsgfgW9fRXZNR0DXe6pDU= github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/grafana/pyroscope-go/godeltaprof v0.1.6 h1:nEdZ8louGAplSvIJi1HVp7kWvFvdiiYg3COLlTwJiFo= diff --git a/vendor/github.com/grafana/jsonparser/bytes.go b/vendor/github.com/grafana/jsonparser/bytes.go index 9d6e701f58364..ce15417e45470 100644 --- a/vendor/github.com/grafana/jsonparser/bytes.go +++ b/vendor/github.com/grafana/jsonparser/bytes.go @@ -17,10 +17,14 @@ func parseInt(bytes []byte) (v int64, ok bool, overflow bool) { } var n uint64 = 0 - for _, c := range bytes { + for idx, c := range bytes { if c < '0' || c > '9' { return 0, false, false } + // Deal with invalid data such as "00" + if n == 0 && idx != 0 { + return 0, false, false + } if n > maxUint64/10 { return 0, false, true } diff --git a/vendor/modules.txt b/vendor/modules.txt index e37e6a0e8c99a..3a0e4162a5b55 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1018,7 +1018,7 @@ github.com/grafana/go-gelf/v2/gelf # github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56 ## explicit; go 1.18 github.com/grafana/gomemcache/memcache -# github.com/grafana/jsonparser v0.0.0-20240209175146-098958973a2d +# github.com/grafana/jsonparser v0.0.0-20240425183733-ea80629e1a32 ## explicit; go 1.13 github.com/grafana/jsonparser # github.com/grafana/loki/pkg/push v0.0.0-20231124142027-e52380921608 => ./pkg/push