You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ab...@apache.org on 2021/03/16 17:23:18 UTC

[ranger] branch ranger-2.2 updated: RANGER-3208: NPE in Ranger policy engine when processing SELF_OR_CHILD scoped search

This is an automated email from the ASF dual-hosted git repository.

abhay pushed a commit to branch ranger-2.2
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/ranger-2.2 by this push:
     new 7bfb57a  RANGER-3208: NPE in Ranger policy engine when processing SELF_OR_CHILD scoped search
7bfb57a is described below

commit 7bfb57a3dc7fa48935c8a252b01b427481307ce2
Author: Abhay Kulkarni <ab...@apache.org>
AuthorDate: Tue Mar 16 10:01:41 2021 -0700

    RANGER-3208: NPE in Ranger policy engine when processing SELF_OR_CHILD scoped search
---
 .../org/apache/ranger/plugin/policyengine/RangerResourceTrie.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerResourceTrie.java b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerResourceTrie.java
index 7149135..2db1db0 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerResourceTrie.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerResourceTrie.java
@@ -1158,7 +1158,9 @@ public class RangerResourceTrie<T extends RangerPolicyResourceEvaluator> {
 
                 children.values().stream().forEach(c -> c.collectChildEvaluators(sep, 0, childEvaluators));
             } else if (sepPos == (str.length() - 1)) { // ex: str=/tmp/test/, startIdx=5
-                childEvaluators.addAll(this.evaluators);
+                if (this.evaluators != null) {
+                    childEvaluators.addAll(this.evaluators);
+                }
             }
         }