From ccc151ae96afd5e81c5aeebac3c593a719b77050 Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Mon, 26 Aug 2024 07:53:25 -0400 Subject: [PATCH] fix: improve regex (#6917) --- .../java/org/owasp/dependencycheck/utils/DependencyVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/owasp/dependencycheck/utils/DependencyVersion.java b/core/src/main/java/org/owasp/dependencycheck/utils/DependencyVersion.java index bbe242b3099..7f14f4e3f43 100644 --- a/core/src/main/java/org/owasp/dependencycheck/utils/DependencyVersion.java +++ b/core/src/main/java/org/owasp/dependencycheck/utils/DependencyVersion.java @@ -78,7 +78,7 @@ public final void parseVersion(String version) { versionParts = new ArrayList<>(); if (version != null) { final Pattern rx = Pattern - .compile("(\\d+[a-z]{1,3}$|[a-z]{1,3}[_-]?\\d+|\\d+|(rc|release|snapshot|beta|alpha)$)", + .compile("(\\d{1,100}[a-z]{1,3}$|[a-z]{1,3}[_-]?\\d{1,100}|\\d{1,100}|(rc|release|snapshot|beta|alpha)$)", Pattern.CASE_INSENSITIVE); final Matcher matcher = rx.matcher(version.toLowerCase()); while (matcher.find()) {