diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2019-09-06 16:39:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-06 16:39:53 +0200 |
commit | a439476f948f52a57485f5e7700b17bf9aa73417 (patch) | |
tree | 896d9a6004db1823620965718c7ab3927180299c | |
parent | 1023fb6526fb716900f2c84bc3a4c7ea76576f74 (diff) | |
parent | 020271a92bd7fc971227ffa098f3ec1ce71075c3 (diff) |
Merge pull request #10546 from vespa-engine/jvenstad/possessive-string-literal-regex
Make the regex possessive, to avoid potential exponential backtrackin… MERGEOK
-rw-r--r-- | bundle-plugin/src/main/java/com/yahoo/container/plugin/osgi/ExportPackageParser.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bundle-plugin/src/main/java/com/yahoo/container/plugin/osgi/ExportPackageParser.java b/bundle-plugin/src/main/java/com/yahoo/container/plugin/osgi/ExportPackageParser.java index 2a255fd9236..f5e9a1b21a7 100644 --- a/bundle-plugin/src/main/java/com/yahoo/container/plugin/osgi/ExportPackageParser.java +++ b/bundle-plugin/src/main/java/com/yahoo/container/plugin/osgi/ExportPackageParser.java @@ -140,7 +140,7 @@ public class ExportPackageParser { a backslash followed by another backslash, a single or double quote, or one of the letters b,f,n,r or t a backslash followed by u followed by four hexadecimal digits ? */ private static Pattern STRING_LITERAL_PATTERN = Pattern - .compile("\"(?:[^\"\\p{Cntrl}\\\\]+|\\\\[\\\\'\"bfnrt]|\\\\u[0-9a-fA-F]{4})+\""); + .compile("\"(?:[^\"\\p{Cntrl}\\\\]++|\\\\[\\\\'\"bfnrt]|\\\\u[0-9a-fA-F]{4})++\""); private static Optional<String> parseStringLiteral(ParsingContext p) { return p.regexp(STRING_LITERAL_PATTERN).map(quoted -> quoted.substring(1, quoted.length() - 1)); |