Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
Log4j-Audit 1.0.1
-
None
-
Java 11
-
Patch
Description
RequestContextMappings inspects the user defined class passed as a constructor parameter, but it checks all fields, instead of just the public static ones (at least that's what I understand it should do).
In Java 8 the issue is covered by catching an IllegalAccessException when accessing the field value, but in Java 11 this throws a NullPointerException for non-static fields.
The proposed solution would be to replace clazz.getDeclaredFields() with clazz.getFields(), to obtain only the accessible public fields, and then check them to process only the static ones.
Attachments
Issue Links
- links to