8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Our SAST shows possible NullPointerException in https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/runtime/ThreadContext.java#L937
private RubyStackTraceElement[] getPartialTrace(int level, Integer length, Stream<StackWalker.StackFrame> stackStream) { if (length != null && length == 0) return RubyStackTraceElement.EMPTY_ARRAY; return TraceType.Gather.CALLER.getBacktraceData(this, stackStream).getPartialBacktrace(runtime, level + length); }
If length can be null, then it will cause NPE at level + length
length
level + length
Environment Information
We are analyzing versions 9.4.x (8-12), but this problem is still in master
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered:
I've made a quick refactoring, hope it's ok
Sorry, something went wrong.
No branches or pull requests
Our SAST shows possible NullPointerException in https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/runtime/ThreadContext.java#L937
If
length
can be null, then it will cause NPE atlevel + length
Environment Information
We are analyzing versions 9.4.x (8-12), but this problem is still in master
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: