Empty values also should be an array as usual
Hi all, thank you for providing security advisories.
I found some cases where an empty value has a different type than usual. For example,
$ wget https://secdb.alpinelinux.org/v3.3/community.json
$ jq . community.json
{
"archs": [
"x86_64",
"x86",
"armhf"
],
"packages": {},
"urlprefix": "http://dl-cdn.alpinelinux.org/alpine",
"distroversion": "v3.3",
"apkurl": "{{urlprefix}}/{{distroversion}}/{{reponame}}/{{arch}}/{{pkg.name}}-{{pkg.ver}}.apk",
"reponame": "community"
}
As shown above, "packages" is an object, even though it is usually an array. It causes an unmarshal error in Go.
json: cannot unmarshal object into Go value of type []alpine.packages
The same issue exists in pkg
as well.
{
"pkg": {
"name": "heimdal",
"secfixes": {
"7.1.0-r1": [
"CVE-2017-11103"
],
"7.1.0-r2": [
"CVE-2017-17439"
],
"7.4.0-r0": {}
}
}
},
It is possible to fix it?