From 5ae0d1567fe5599aa6693662abe8f134fc964bea Mon Sep 17 00:00:00 2001 From: memeeerit Date: Thu, 30 Nov 2023 10:01:26 -0500 Subject: [PATCH] misc fixes --- .../edu/rit/se/nvip/db/repositories/NvdMitreRepository.java | 4 +++- reconciler/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/db/src/main/java/edu/rit/se/nvip/db/repositories/NvdMitreRepository.java b/db/src/main/java/edu/rit/se/nvip/db/repositories/NvdMitreRepository.java index f09dc6cb0..3bae0e773 100644 --- a/db/src/main/java/edu/rit/se/nvip/db/repositories/NvdMitreRepository.java +++ b/db/src/main/java/edu/rit/se/nvip/db/repositories/NvdMitreRepository.java @@ -228,9 +228,11 @@ public Set attachNvdVulns(Set vu String cveId = null; String lastCveId = null; Map> sourceMap = new HashMap<>(); + boolean foundOne = false; while (res.next()) { // goes through each matching cve_id, creates the NvdVuln and attaches it to the CompVuln // Store last cve id to determine duplicate entries lastCveId = cveId; + foundOne = true; // Update cveId value cveId = res.getString("cve_id"); @@ -256,7 +258,7 @@ public Set attachNvdVulns(Set vu } // If only one result was found - if(lastCveId == null) { + if(lastCveId == null && foundOne) { NvdVulnerability nvdVuln = new NvdVulnerability( cveId, res.getTimestamp("published_date"), diff --git a/reconciler/Dockerfile b/reconciler/Dockerfile index 09c5323dd..99d0649f9 100644 --- a/reconciler/Dockerfile +++ b/reconciler/Dockerfile @@ -17,7 +17,7 @@ RUN mvn dependency:go-offline --projects=reconciler ADD reconciler/src/main reconciler/src/main -RUN mvn package -Dmaven.test.skip=true --projects=reconciler +RUN mvn package -Dmaven.test.skip=true --projects=db,reconciler ### Reconciler Run Stage FROM openjdk:11-jre-slim