You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/10/19 03:41:22 UTC

[GitHub] [commons-jxpath] kyakdan commented on a diff in pull request #26: Fix CVE-2022-41852

kyakdan commented on code in PR #26:
URL: https://github.com/apache/commons-jxpath/pull/26#discussion_r998912350


##########
src/main/java/org/apache/commons/jxpath/ClassFunctions.java:
##########
@@ -92,6 +93,28 @@ public Function getFunction(
         String namespace,
         String name,
         Object[] parameters) {
+        return getFunction(namespace, name, parameters, null);
+    }
+
+    public Function getFunction(
+            String namespace,
+            String name,
+            Object[] parameters,
+            JXPathFilter jxPathFilter) {
+
+        // give chance to ClassFilter to filter out, if present
+        try {
+            if (jxPathFilter != null && !jxPathFilter.exposeToXPath(functionClass.getName())) {
+                throw new ClassNotFoundException(functionClass.getName());

Review Comment:
   Good point! Changed to throwing a JXPathException directly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org