1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

Make json parsing more strict
Some checks are pending
Go / build (push) Waiting to run
Go / run_modver (push) Blocked by required conditions

This commit is contained in:
koplas 2025-07-02 17:06:25 +02:00
parent c833c00f84
commit fc3837d655
No known key found for this signature in database
13 changed files with 68 additions and 36 deletions

View file

@ -12,7 +12,6 @@ package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"go/format"
@ -22,6 +21,8 @@ import (
"sort"
"strings"
"text/template"
"github.com/gocsaf/csaf/v3/internal/misc"
)
// We from Intevation consider the source code parts in the following
@ -98,7 +99,7 @@ func loadSchema(filename string) (*schema, error) {
}
defer f.Close()
var s schema
if err := json.NewDecoder(f).Decode(&s); err != nil {
if err := misc.StrictJSONParse(f, &s); err != nil {
return nil, err
}
return &s, nil