From 940d8e4a950d8ce8075a712d9dc3852de828e5b5 Mon Sep 17 00:00:00 2001 From: DylanB95EST Date: Mon, 24 May 2021 10:04:49 +0100 Subject: Adding Atomic Grouping to Discard backtracking once matched as part of Sonar Security Hotspot Fix Issue-ID: CPS-89 Commit-ID: b23ee774ae2a2305f1feea747931879588f9cada Change-Id: I1f9d54246370b0c0bc8ec3d167eaed27ad58471b Signed-off-by: DylanB95EST --- cps-ri/src/main/java/org/onap/cps/spi/query/CpsPathQuery.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cps-ri/src/main/java/org') diff --git a/cps-ri/src/main/java/org/onap/cps/spi/query/CpsPathQuery.java b/cps-ri/src/main/java/org/onap/cps/spi/query/CpsPathQuery.java index c8886689ec..401667eaa4 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/query/CpsPathQuery.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/query/CpsPathQuery.java @@ -65,9 +65,9 @@ public class CpsPathQuery { private static final String INDIVIDUAL_LEAF_DETAIL_PATTERN = ("\\s{1,9}and\\s{1,9}"); - private static final Pattern LEAF_VALUE_PATTERN = Pattern.compile("@(\\S+?)=(.*+)"); + private static final Pattern LEAF_VALUE_PATTERN = Pattern.compile("@(?>(\\S+?)=(.*))"); - private static final Pattern ANCESTOR_AXIS_PATTERN = Pattern.compile("(\\S+)\\/ancestor::\\/?(\\S++)"); + private static final Pattern ANCESTOR_AXIS_PATTERN = Pattern.compile("(?>(\\S+)\\/ancestor::\\/?(\\S+))"); /** * Returns a cps path query. -- cgit 1.2.3-korg