diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-03-18 21:56:00 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-03-18 21:56:00 -0400 |
commit | b68b602dd61f28b37d0abe1fde70e29303b43e7c (patch) | |
tree | fc7d8cae444624970a629f16f785685277ed5312 /dbstore | |
parent | dc0be0efa4b2320f5859a9df33de2f67199d69ef (diff) | |
download | cvez-b68b602dd61f28b37d0abe1fde70e29303b43e7c.tar.bz2 cvez-b68b602dd61f28b37d0abe1fde70e29303b43e7c.zip |
dbstore/dbstore.go: CisaSearch(): json_group_array() aggregates rows in an arbitrary order, so use sort.Sort() to sort the results in ascending order
Diffstat (limited to 'dbstore')
-rw-r--r-- | dbstore/dbstore.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/dbstore/dbstore.go b/dbstore/dbstore.go index 08da511..a80aea6 100644 --- a/dbstore/dbstore.go +++ b/dbstore/dbstore.go @@ -11,6 +11,7 @@ import ( "github.com/pablotron/cvez/cpedict" "github.com/pablotron/cvez/cpematch" nvd_feed "github.com/pablotron/cvez/feed" + "sort" ) // sqlite3 backing store @@ -901,6 +902,9 @@ func (me DbStore) CisaSearch( return json.Unmarshal([]byte(s), &r) }) + // sort results by rank + sort.Sort(byRank(r)) + // return results return r, err } |