8000 Possible NPE in PopenExecutor:pipeOpen() found by SAST · Issue #8807 · jruby/jruby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Possible NPE in PopenExecutor:pipeOpen() found by SAST #8807

New issue

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

Open
ngr-ilmarh opened this issue Apr 29, 2025 · 0 comments
Open

Possible NPE in PopenExecutor:pipeOpen() found by SAST #8807

ngr-ilmarh opened this issue Apr 29, 2025 · 0 comments

Comments

@ngr-ilmarh
Copy link

Our SAST shows possible NullPointerException in https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/util/io/PopenExecutor.java#L567

    private RubyIO pipeOpen(ThreadContext context, ExecArg eargp, String modestr, int fmode, IOEncodable convconfig) {
        final Ruby runtime = context.runtime;
        IRubyObject prog = eargp != null ? (eargp.use_shell ? eargp.command_name : eargp.command_name) : null;

...

        if (eargp.chdirGiven) {

If eargp can be null, as stated earlier, then it will cause NullPointerException at eargp.chdirGiven

Environment Information

We are analyzing versions 9.4.x (8-12), but this problem is still in master

Expected Behavior

  • No NPE at all. But it seems nobody catch it through the years, so i don't know if this arg may hold null at all

Actual Behavior

  • I have no tests to show this NPE, can't figure out how to make one. This is simply code analysis, that showed possible NPE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0