-
Notifications
You must be signed in to change notification settings - Fork 1.2k
One NPE in RouterChain.java #1048
Copy link
Copy link
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
Hello,
Our static analyzer found a following potential NPE. We have checked the feasibility of this execution trace. It is necessary to defend this vulnerability to improve the code quality.
Here is the bug trace.
-
Return null to caller
return all == null ? null : all.get(alias); -
Function getExtensionClass executes and stores the return value to the parameter of add, which can be null
extensionRouters.add(EXTENSION_LOADER.getExtensionClass(routerAlias)); -
Function add executes and returns. One of the elements in extensionRouters can be null.
extensionRouters.add(EXTENSION_LOADER.getExtensionClass(routerAlias)); -
Function next executes and stores the return value to extensionRouter (extensionRouter can be null)
for (ExtensionClass<Router> extensionRouter : extensionRouters) { -
extensionRouter is passed as this pointer to function getExtInstance (extensionRouter can be null), which will lead to null pointer dereference
Router actualRoute = extensionRouter.getExtInstance();
Commit: 4f824e2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers