Skip to content

Commit 7962626

Browse files
authored
Improved coverage for bzip2 (#597)
1 parent c5b30f1 commit 7962626

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

cve_bin_tool/checkers/bzip2.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def get_version(lines, filename):
2323
"""
2424
regex = [r"bzip2-([0-9]+\.[0-9]+\.[0-9]+)"]
2525
version_info = dict()
26-
version = "UNKNOWN"
2726
version = regex_find(lines, *regex)
2827

2928
if "bzip2" in filename:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <stdio.h>
2+
3+
int main() {
4+
printf("This program is designed to test the cve-bin-tool checker.");
5+
printf("It outputs a few strings normally associated with bzip2-1.0.2");
6+
printf("They appear below this line.");
7+
printf("------------------");
8+
printf("bzip2-1.0.2");
9+
10+
return 0;
11+
}

test/test_scanner.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,22 @@ def _file_test(self, url, filename, package, version):
671671
"CVE-2002-0760"
672672
],
673673
),
674+
(
675+
"test-b.zip2-1.0.2_imprv_covrg.out",
676+
"bzip2",
677+
"1.0.2",
678+
[
679+
# Check for known cves in this version
680+
"CVE-2005-0953",
681+
"CVE-2008-1372",
682+
"CVE-2010-0405",
683+
"CVE-2011-4089",
684+
],
685+
[
686+
# Check to make sure an older CVE isn't included
687+
"CVE-2002-0760"
688+
],
689+
),
674690
(
675691
"test-sqlite-3.12.2.out",
676692
"sqlite",

0 commit comments

Comments
 (0)