vendor: github.com/valyala/fastjson v1.6.7

- pool.go: add missing Arena.Reset() call inside ArenaPool.Put()
- Treat nil values as null in SetArrayItem
  prevents a potential panic when a nil value is used as an array item

full diff: https://github.com/valyala/fastjson/compare/v1.6.4...v1.6.7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2026-07-01 15:31:33 +02:00
parent 0ff357e4be
commit 3f0b52dc73
8 changed files with 13 additions and 9 deletions
+1 -1
View File
@@ -207,7 +207,7 @@ require (
github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect
github.com/transparency-dev/formats v0.1.1 // indirect github.com/transparency-dev/formats v0.1.1 // indirect
github.com/transparency-dev/merkle v0.0.2 // indirect github.com/transparency-dev/merkle v0.0.2 // indirect
github.com/valyala/fastjson v1.6.4 // indirect github.com/valyala/fastjson v1.6.7 // indirect
github.com/vektah/gqlparser/v2 v2.5.30 // indirect github.com/vektah/gqlparser/v2 v2.5.30 // indirect
github.com/x448/float16 v0.8.4 // indirect github.com/x448/float16 v0.8.4 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
+2 -2
View File
@@ -576,8 +576,8 @@ github.com/transparency-dev/formats v0.1.1 h1:4bVHJc+KdBgpA1OJD1yjI+g0i5Z1graCpp
github.com/transparency-dev/formats v0.1.1/go.mod h1:qtZ8goRuJ8FTBG9c9+Bj0rn2rUG7eG/AUTkr+Aw3jFw= github.com/transparency-dev/formats v0.1.1/go.mod h1:qtZ8goRuJ8FTBG9c9+Bj0rn2rUG7eG/AUTkr+Aw3jFw=
github.com/transparency-dev/merkle v0.0.2 h1:Q9nBoQcZcgPamMkGn7ghV8XiTZ/kRxn1yCG81+twTK4= github.com/transparency-dev/merkle v0.0.2 h1:Q9nBoQcZcgPamMkGn7ghV8XiTZ/kRxn1yCG81+twTK4=
github.com/transparency-dev/merkle v0.0.2/go.mod h1:pqSy+OXefQ1EDUVmAJ8MUhHB9TXGuzVAT58PqBoHz1A= github.com/transparency-dev/merkle v0.0.2/go.mod h1:pqSy+OXefQ1EDUVmAJ8MUhHB9TXGuzVAT58PqBoHz1A=
github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ= github.com/valyala/fastjson v1.6.7 h1:ZE4tRy0CIkh+qDc5McjatheGX2czdn8slQjomexVpBM=
github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/valyala/fastjson v1.6.7/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
github.com/vbatts/tar-split v0.12.3 h1:Cd46rkGXI3Td4yrVNwU8ripbxFaQbmesqhjBUUYAJSw= github.com/vbatts/tar-split v0.12.3 h1:Cd46rkGXI3Td4yrVNwU8ripbxFaQbmesqhjBUUYAJSw=
github.com/vbatts/tar-split v0.12.3/go.mod h1:sQOc6OlqGCr7HkGx/IDBeKiTIvqhmj8KffNhEXG4Nq0= github.com/vbatts/tar-split v0.12.3/go.mod h1:sQOc6OlqGCr7HkGx/IDBeKiTIvqhmj8KffNhEXG4Nq0=
github.com/vektah/gqlparser/v2 v2.5.30 h1:EqLwGAFLIzt1wpx1IPpY67DwUujF1OfzgEyDsLrN6kE= github.com/vektah/gqlparser/v2 v2.5.30 h1:EqLwGAFLIzt1wpx1IPpY67DwUujF1OfzgEyDsLrN6kE=
+4 -4
View File
@@ -8,10 +8,10 @@ import (
// //
// Typical Arena lifecycle: // Typical Arena lifecycle:
// //
// 1) Construct Values via the Arena and Value.Set* calls. // 1. Construct Values via the Arena and Value.Set* calls.
// 2) Marshal the constructed Values with Value.MarshalTo call. // 2. Marshal the constructed Values with Value.MarshalTo call.
// 3) Reset all the constructed Values at once by Arena.Reset call. // 3. Reset all the constructed Values at once by Arena.Reset call.
// 4) Go to 1 and re-use the Arena. // 4. Go to 1 and re-use the Arena.
// //
// It is unsafe calling Arena methods from concurrent goroutines. // It is unsafe calling Arena methods from concurrent goroutines.
// Use per-goroutine Arenas or ArenaPool instead. // Use per-goroutine Arenas or ArenaPool instead.
-1
View File
@@ -4,6 +4,5 @@ Package fastjson provides fast JSON parsing.
Arbitrary JSON may be parsed by fastjson without the need for creating structs Arbitrary JSON may be parsed by fastjson without the need for creating structs
or for generating go code. Just parse JSON and get the required fields with or for generating go code. Just parse JSON and get the required fields with
Get* functions. Get* functions.
*/ */
package fastjson package fastjson
+1
View File
@@ -1,3 +1,4 @@
//go:build gofuzz
// +build gofuzz // +build gofuzz
package fastjson package fastjson
+1
View File
@@ -48,5 +48,6 @@ func (ap *ArenaPool) Get() *Arena {
// //
// a and objects created by a cannot be used after a is put into ap. // a and objects created by a cannot be used after a is put into ap.
func (ap *ArenaPool) Put(a *Arena) { func (ap *ArenaPool) Put(a *Arena) {
a.Reset()
ap.pool.Put(a) ap.pool.Put(a)
} }
+3
View File
@@ -106,5 +106,8 @@ func (v *Value) SetArrayItem(idx int, value *Value) {
for idx >= len(v.a) { for idx >= len(v.a) {
v.a = append(v.a, valueNull) v.a = append(v.a, valueNull)
} }
if value == nil {
value = valueNull
}
v.a[idx] = value v.a[idx] = value
} }
+1 -1
View File
@@ -1131,7 +1131,7 @@ github.com/transparency-dev/merkle
github.com/transparency-dev/merkle/compact github.com/transparency-dev/merkle/compact
github.com/transparency-dev/merkle/proof github.com/transparency-dev/merkle/proof
github.com/transparency-dev/merkle/rfc6962 github.com/transparency-dev/merkle/rfc6962
# github.com/valyala/fastjson v1.6.4 # github.com/valyala/fastjson v1.6.7
## explicit; go 1.12 ## explicit; go 1.12
github.com/valyala/fastjson github.com/valyala/fastjson
github.com/valyala/fastjson/fastfloat github.com/valyala/fastjson/fastfloat