diff options
author | Paul Wise <pabs@debian.org> | 2017-02-19 09:49:09 +0000 |
---|---|---|
committer | Paul Wise <pabs@debian.org> | 2017-02-19 09:49:09 +0000 |
commit | 9970cdf872966313e5b9f41034da65d4bd6d6569 (patch) | |
tree | 582b496848dccd8f09750dfa1c93fb4ee5ff33fb /bin/compare-nvd-cve | |
parent | f58383ce27eac9c11380fcd9893583375368aac7 (diff) |
Avoid hard-coding the list of years since 2002
Calculate the range based on the current year.
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@49060 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/compare-nvd-cve')
-rwxr-xr-x | bin/compare-nvd-cve | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/bin/compare-nvd-cve b/bin/compare-nvd-cve index 1fffbde745..707ac839ea 100755 --- a/bin/compare-nvd-cve +++ b/bin/compare-nvd-cve @@ -45,26 +45,10 @@ while (<$fh>) { close $fh; # -# Fetched from http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-2016.xml.gz +# Fetched from https://nvd.nist.gov/download.aspx # -for my $cvelist - ( - "nvdcve-2.0-2016.xml", - "nvdcve-2.0-2015.xml", - "nvdcve-2.0-2014.xml", - "nvdcve-2.0-2013.xml", - "nvdcve-2.0-2012.xml", - "nvdcve-2.0-2011.xml", - "nvdcve-2.0-2010.xml", - "nvdcve-2.0-2009.xml", - "nvdcve-2.0-2008.xml", - "nvdcve-2.0-2007.xml", - "nvdcve-2.0-2006.xml", - "nvdcve-2.0-2005.xml", - "nvdcve-2.0-2004.xml", - "nvdcve-2.0-2003.xml", - "nvdcve-2.0-2002.xml", - ) { +for my $year (reverse 2002 .. (gmtime())[5]+1900) { + my $cvelist = "nvdcve-2.0-$year.xml"; print STDERR "Loading $cvelist\n" if $debug; my $ref = XMLin("data/nvd2/" . $cvelist); for my $cve (sort {$b cmp $a} keys %{$ref->{entry}}) { |