We're updating the issue view to help you get more done. 

SimplePDP throws NotInitializedException (with cause NullPointerException) if an unknown function ID is used in a target matcher

Description

Steps to reproduce:

  • configure attached policy and use it with any evaluate call

Expected result:

  • processing error (INDETERMINATE) caused by a syntax error

Actual result:

  • evaluation is aborted with a runtime exception:

org.herasaf.xacml.core.NotInitializedException: java.lang.NullPointerException
at org.herasaf.xacml.core.combiningAlgorithm.AbstractCombiningAlgorithm.matchTarget(AbstractCombiningAlgorithm.java:81)
at org.herasaf.xacml.core.combiningAlgorithm.rule.RuleUnorderedCombiningAlgorithm.evaluate(RuleUnorderedCombiningAlgorithm.java:43)
at org.herasaf.xacml.core.combiningAlgorithm.policy.impl.PolicyFirstApplicableAlgorithm.evaluateEvaluatableList(PolicyFirstApplicableAlgorithm.java:104)
at org.herasaf.xacml.core.combiningAlgorithm.policy.PolicyOrderedCombiningAlgorithm.evaluate(PolicyOrderedCombiningAlgorithm.java:54)
at org.herasaf.xacml.core.combiningAlgorithm.policy.impl.PolicyOnlyOneApplicableAlgorithm.evaluateEvaluatableList(PolicyOnlyOneApplicableAlgorithm.java:112)
at org.herasaf.xacml.core.simplePDP.SimplePDP.evaluate(SimplePDP.java:180)
at nl.forcare.auth.pdp.HerasLearningTest.testShouldNotThrowNPEForUnknownFunctionId(HerasLearningTest.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:110)
at nl.forcare.common.test.ExceptionAwareStatement.evaluate(ExceptionAwareStatement.java:24)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.NullPointerException
at org.herasaf.xacml.core.targetMatcher.impl.TargetMatcherImpl.match(TargetMatcherImpl.java:257)
at org.herasaf.xacml.core.targetMatcher.impl.TargetMatcherImpl.resourcesMatch(TargetMatcherImpl.java:156)
at org.herasaf.xacml.core.targetMatcher.impl.TargetMatcherImpl.match(TargetMatcherImpl.java:70)
at org.herasaf.xacml.core.combiningAlgorithm.AbstractCombiningAlgorithm.matchTarget(AbstractCombiningAlgorithm.java:62)
... 34 more

Environment

any

Status

Assignee

Florian Huonder

Reporter

Walco van Loon

Labels

None

Time tracking

4h

Components

Fix versions

Priority

Major