diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java index 47fc8b015..21e3cc5e0 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java @@ -237,9 +237,10 @@ public class DependencyBundlingAnalyzer extends AbstractAnalyzer { if (tmp <= 0) { return path; } - if (tmp > 0) { + //below is always true + //if (tmp > 0) { pos = tmp + 1; - } + //} tmp = path.indexOf(File.separator, pos); if (tmp > 0) { pos = tmp + 1; diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/NvdCveUpdater.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/NvdCveUpdater.java index b5fc703cd..c2b477b76 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/NvdCveUpdater.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/NvdCveUpdater.java @@ -302,12 +302,14 @@ public class NvdCveUpdater implements CachedWebDataSource { } } - if (maxUpdates >= 1) { //ensure the modified file date gets written (we may not have actually updated it) + //always true because <=0 exits early above + //if (maxUpdates >= 1) { + //ensure the modified file date gets written (we may not have actually updated it) dbProperties.save(updateable.get(MODIFIED)); LOGGER.info("Begin database maintenance."); cveDb.cleanupDatabase(); LOGGER.info("End database maintenance."); - } + //} } /** diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java index fe4b07666..4eccc0129 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java @@ -249,7 +249,8 @@ public final class ExtractionUtil { throw new IOException("Unable to rename '" + file.getPath() + "'"); } final File newFile = new File(originalPath); - try (GZIPInputStream cin = new GZIPInputStream(new FileInputStream(gzip)); + try (FileInputStream fis = new FileInputStream(gzip); + GZIPInputStream cin = new GZIPInputStream(fis); FileOutputStream out = new FileOutputStream(newFile)) { IOUtils.copy(cin, out); } finally {