You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In file InvocationContainerImpl.java line 87answer(invocation) method is called on the return value of findAnswerFor(invocation). The method findAnswerFor(invocation) might return null but no null check is performed on the returned value inside the answerTo method which might cause null pointer exception. Here's the affected code snippet:
ObjectanswerTo(Invocationinvocation) throwsThrowable {
returnfindAnswerFor(invocation).answer(invocation);
}
publicStubbedInvocationMatcherfindAnswerFor(Invocationinvocation) {
synchronized (stubbed) {
for (StubbedInvocationMatchers : stubbed) {
if (s.matches(invocation)) {
s.markStubUsed(invocation);
// TODO we should mark stubbed at the point of stubbing, not at the point where// the stub is being usedinvocation.markStubbed(newStubInfoImpl(s));
returns;
}
}
}
returnnull;
}
The static analysis was ran on version: v4.11.0
Sponsorship and Support
This work is done by the security researchers from OpenRefactory and is supported by the Open Source Security Foundation (OpenSSF): Project Alpha-Omega. Alpha-Omega is a project partnering with open source software project maintainers to systematically find new, as-yet-undiscovered vulnerabilities in open source code - and get them fixed - to improve global software supply chain security.
The bug is found by running the Intelligent Code Repair (iCR) tool by OpenRefactory and then manually triaging the results.
The text was updated successfully, but these errors were encountered:
abdullahil-kafi
changed the title
Unchecked Null Dereference Bug which might cause Null dereference exception
Unchecked Null Dereference which might cause Null pointer exception
Oct 29, 2024
Summary
In file InvocationContainerImpl.java line 87
answer(invocation)
method is called on the return value offindAnswerFor(invocation)
. The methodfindAnswerFor(invocation)
might returnnull
but no null check is performed on the returned value inside theanswerTo
method which might cause null pointer exception. Here's the affected code snippet:The static analysis was ran on version:
v4.11.0
Sponsorship and Support
This work is done by the security researchers from OpenRefactory and is supported by the Open Source Security Foundation (OpenSSF): Project Alpha-Omega. Alpha-Omega is a project partnering with open source software project maintainers to systematically find new, as-yet-undiscovered vulnerabilities in open source code - and get them fixed - to improve global software supply chain security.
The bug is found by running the Intelligent Code Repair (iCR) tool by OpenRefactory and then manually triaging the results.
The text was updated successfully, but these errors were encountered: