| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package NIST::NVD::Store::Base; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
12731
|
use warnings; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
77
|
|
|
4
|
2
|
|
|
2
|
|
13
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
84
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
14
|
use Carp(qw(croak)); |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
1499
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.00.00'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head2 get_cve_for_cpe |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
|
13
|
|
|
|
|
|
|
|
|
14
|
0
|
|
|
0
|
1
|
|
sub get_cve_for_cpe { |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
} |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head2 get_cve |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
|
22
|
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
1
|
|
sub get_cve { |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 put_cpe |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
|
31
|
|
|
|
|
|
|
|
|
32
|
0
|
|
|
0
|
1
|
|
sub put_cpe { |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
0
|
|
|
0
|
|
|
sub _get_default_args { |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 new |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
The constructor for classes which inherit from |
|
43
|
|
|
|
|
|
|
NIST::NVD::Store::Base, if they don't implement it themselves |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub new { |
|
48
|
0
|
|
|
0
|
1
|
|
(my( $class, %args )) = @_; |
|
49
|
0
|
|
0
|
|
|
|
$class //= ref $class; |
|
50
|
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
my $self = bless {store => $args{store}}, $class; |
|
52
|
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
my $store = $args{store}; |
|
54
|
|
|
|
|
|
|
|
|
55
|
0
|
0
|
|
|
|
|
carp('database argument is required, but was not passed') |
|
56
|
|
|
|
|
|
|
unless exists $args{database}; |
|
57
|
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
$self->{$store} = $self->_connect_db( database => $args{database} ); |
|
59
|
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
return $self; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub _important_fields { |
|
64
|
|
|
|
|
|
|
return |
|
65
|
0
|
|
|
0
|
|
|
qw( |
|
66
|
|
|
|
|
|
|
vuln:cve-id |
|
67
|
|
|
|
|
|
|
vuln:cvss |
|
68
|
|
|
|
|
|
|
vuln:cwe |
|
69
|
|
|
|
|
|
|
vuln:discovered-datetime |
|
70
|
|
|
|
|
|
|
vuln:published-datetime |
|
71
|
|
|
|
|
|
|
vuln:discovered-datetime |
|
72
|
|
|
|
|
|
|
vuln:last-modified-datetime |
|
73
|
|
|
|
|
|
|
vuln:security-protection |
|
74
|
|
|
|
|
|
|
vuln:vulnerable-software-list |
|
75
|
|
|
|
|
|
|
); |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
our $AUTOLOAD; |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub AUTOLOAD { |
|
82
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
83
|
0
|
0
|
|
|
|
|
my $type = ref($self) |
|
84
|
|
|
|
|
|
|
or croak "$self is not an object"; |
|
85
|
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
my $name = $AUTOLOAD; |
|
87
|
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
$name =~ s/^.*://; |
|
89
|
|
|
|
|
|
|
|
|
90
|
0
|
0
|
|
|
|
|
return if $name eq 'DESTROY'; |
|
91
|
|
|
|
|
|
|
|
|
92
|
0
|
0
|
|
|
|
|
croak "$type does not yet implement $name. Don't call it." |
|
93
|
|
|
|
|
|
|
unless $type->can($name); |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
|
|
96
|
0
|
|
|
0
|
|
|
sub DESTROY {} |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
1; |