From 3f02b25423837f32051000fabd37bce2ff592d64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 11:44:11 +0000 Subject: [PATCH 1/2] Bump github.com/mailru/easyjson from 0.9.1 to 0.9.2 in /cmsdev Bumps [github.com/mailru/easyjson](https://github.com/mailru/easyjson) from 0.9.1 to 0.9.2. - [Release notes](https://github.com/mailru/easyjson/releases) - [Commits](https://github.com/mailru/easyjson/compare/v0.9.1...v0.9.2) --- updated-dependencies: - dependency-name: github.com/mailru/easyjson dependency-version: 0.9.2 dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- cmsdev/go.mod | 2 +- cmsdev/go.sum | 4 +- .../mailru/easyjson/jwriter/writer.go | 43 ++++++++++++------- cmsdev/vendor/modules.txt | 2 +- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/cmsdev/go.mod b/cmsdev/go.mod index 81857e92..e56b3122 100644 --- a/cmsdev/go.mod +++ b/cmsdev/go.mod @@ -60,7 +60,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/magiconair/properties v1.8.10 // indirect - github.com/mailru/easyjson v0.9.1 // indirect + github.com/mailru/easyjson v0.9.2 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect diff --git a/cmsdev/go.sum b/cmsdev/go.sum index b1a3dfd4..2060d7ca 100644 --- a/cmsdev/go.sum +++ b/cmsdev/go.sum @@ -858,8 +858,8 @@ github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8S github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.9.1 h1:LbtsOm5WAswyWbvTEOqhypdPeZzHavpZx96/n553mR8= -github.com/mailru/easyjson v0.9.1/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= +github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M= +github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= diff --git a/cmsdev/vendor/github.com/mailru/easyjson/jwriter/writer.go b/cmsdev/vendor/github.com/mailru/easyjson/jwriter/writer.go index 34b0ade4..432bade1 100644 --- a/cmsdev/vendor/github.com/mailru/easyjson/jwriter/writer.go +++ b/cmsdev/vendor/github.com/mailru/easyjson/jwriter/writer.go @@ -2,7 +2,9 @@ package jwriter import ( + "fmt" "io" + "math" "strconv" "unicode/utf8" @@ -67,18 +69,6 @@ func (w *Writer) RawString(s string) { w.Buffer.AppendString(s) } -// RawBytesString appends string from bytes to the buffer. -func (w *Writer) RawBytesString(data []byte, err error) { - switch { - case w.Error != nil: - return - case err != nil: - w.Error = err - default: - w.String(string(data)) - } -} - // Raw appends raw binary data to the buffer or sets the error if it is given. Useful for // calling with results of MarshalJSON-like functions. func (w *Writer) Raw(data []byte, err error) { @@ -102,10 +92,8 @@ func (w *Writer) RawText(data []byte, err error) { return case err != nil: w.Error = err - case len(data) > 0: - w.String(string(data)) default: - w.RawString("null") + w.String(string(data)) } } @@ -248,11 +236,19 @@ func (w *Writer) Int64Str(n int64) { } func (w *Writer) Float32(n float32) { + if w.checkIsUnsupportedFloat(float64(n)) { + return + } + w.Buffer.EnsureSpace(20) w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 32) } func (w *Writer) Float32Str(n float32) { + if w.checkIsUnsupportedFloat(float64(n)) { + return + } + w.Buffer.EnsureSpace(20) w.Buffer.Buf = append(w.Buffer.Buf, '"') w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 32) @@ -260,11 +256,19 @@ func (w *Writer) Float32Str(n float32) { } func (w *Writer) Float64(n float64) { + if w.checkIsUnsupportedFloat(n) { + return + } + w.Buffer.EnsureSpace(20) w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, n, 'g', -1, 64) } func (w *Writer) Float64Str(n float64) { + if w.checkIsUnsupportedFloat(n) { + return + } + w.Buffer.EnsureSpace(20) w.Buffer.Buf = append(w.Buffer.Buf, '"') w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 64) @@ -415,3 +419,12 @@ func (w *Writer) base64(in []byte) { w.Buffer.Buf = append(w.Buffer.Buf, byte(padChar), byte(padChar)) } } + +func (w *Writer) checkIsUnsupportedFloat(val float64) bool { + isUnsupported := math.IsNaN(val) || math.IsInf(val, 0) + if isUnsupported && w.Error == nil { + w.Error = fmt.Errorf("json: unsupported value: %v", val) + } + + return isUnsupported +} diff --git a/cmsdev/vendor/modules.txt b/cmsdev/vendor/modules.txt index c647c6b5..4d844a9f 100644 --- a/cmsdev/vendor/modules.txt +++ b/cmsdev/vendor/modules.txt @@ -77,7 +77,7 @@ github.com/json-iterator/go # github.com/magiconair/properties v1.8.10 ## explicit; go 1.19 github.com/magiconair/properties -# github.com/mailru/easyjson v0.9.1 +# github.com/mailru/easyjson v0.9.2 ## explicit; go 1.20 github.com/mailru/easyjson/buffer github.com/mailru/easyjson/jlexer From 8f8257d0d49a39366e06788722e8e3d24e1e7511 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 11:44:26 +0000 Subject: [PATCH 2/2] Updated Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a7d2401..0ea33178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bump `github.com/go-openapi/swag/jsonname` from 0.25.3 to 0.25.4 ([#335](https://github.com/Cray-HPE/cms-tools/pull/335)) - Bump `github.com/sirupsen/logrus` from 1.9.3 to 1.9.4 ([#346](https://github.com/Cray-HPE/cms-tools/pull/346)) - Bump `github.com/go-openapi/jsonreference` from 0.21.3 to 0.21.5 ([#349](https://github.com/Cray-HPE/cms-tools/pull/349)) +- Bump `github.com/mailru/easyjson` from 0.9.1 to 0.9.2 ([#353](https://github.com/Cray-HPE/cms-tools/pull/353)) ## [1.34.2] - 2026-03-12