mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 05:40:11 +01:00
Make json parsing more strict
This commit is contained in:
parent
c833c00f84
commit
fc3837d655
13 changed files with 68 additions and 36 deletions
|
|
@ -35,6 +35,7 @@ import (
|
|||
"golang.org/x/time/rate"
|
||||
|
||||
"github.com/gocsaf/csaf/v3/csaf"
|
||||
"github.com/gocsaf/csaf/v3/internal/misc"
|
||||
"github.com/gocsaf/csaf/v3/util"
|
||||
)
|
||||
|
||||
|
|
@ -551,7 +552,7 @@ func (dc *downloadContext) downloadAdvisory(
|
|||
|
||||
tee := io.TeeReader(resp.Body, hasher)
|
||||
|
||||
if err := json.NewDecoder(tee).Decode(&doc); err != nil {
|
||||
if err := misc.StrictJSONParse(tee, &doc); err != nil {
|
||||
dc.stats.downloadFailed++
|
||||
slog.Warn("Downloading failed",
|
||||
"url", file.URL(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue