mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-25 02:21:28 +01:00
updated test case per issue #792
This commit is contained in:
@@ -43,5 +43,25 @@ Copyright (c) 2017 Jeremy Long. All Rights Reserved.
|
|||||||
<artifactId>jackson-dataformat-xml</artifactId>
|
<artifactId>jackson-dataformat-xml</artifactId>
|
||||||
<version>2.4.5</version>
|
<version>2.4.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.module</groupId>
|
||||||
|
<artifactId>jackson-module-kotlin</artifactId>
|
||||||
|
<version>2.8.9</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||||
|
<artifactId>jackson-dataformat-ion</artifactId>
|
||||||
|
<version>2.8.9</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-hppc</artifactId>
|
||||||
|
<version>2.8.9</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
||||||
|
<artifactId>jackson-jaxrs-yaml-provider</artifactId>
|
||||||
|
<version>2.8.9</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -24,7 +24,12 @@ import java.nio.charset.Charset;
|
|||||||
// Check to see if jackson-dataformat-xml-2.4.5.jar was identified.
|
// Check to see if jackson-dataformat-xml-2.4.5.jar was identified.
|
||||||
//TODO change this to xpath and check for CVE-2016-3720
|
//TODO change this to xpath and check for CVE-2016-3720
|
||||||
String log = FileUtils.readFileToString(new File(basedir, "target/dependency-check-report.xml"), Charset.defaultCharset().name());
|
String log = FileUtils.readFileToString(new File(basedir, "target/dependency-check-report.xml"), Charset.defaultCharset().name());
|
||||||
int count = StringUtils.countMatches(log, "<fileName>jackson-dataformat-xml-2.4.5.jar</fileName>");
|
int count = StringUtils.countMatches(log, "<name>CVE-2016-7051</name>");
|
||||||
|
if (count == 0){
|
||||||
|
System.out.println(String.format("jackson-dataformat-xml was identified %s times, expected 1", count));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
count = StringUtils.countMatches(log, "<name>CVE-2016-3720</name>");
|
||||||
if (count == 0){
|
if (count == 0){
|
||||||
System.out.println(String.format("jackson-dataformat-xml was identified %s times, expected 1", count));
|
System.out.println(String.format("jackson-dataformat-xml was identified %s times, expected 1", count));
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user