mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 18:15:42 +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
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue