Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51955

SlaveComputer#setChannel(Channel,OutputStream,Channel.Listener) may throw null in the case of valid API usages

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core

      The second parameter for SlaveComputer#setChannel(Channel,OutputStream,Channel.Listener) is launchLog.

      According to Javadoc of another method, it may be null. " If non-null, receive the portion of data in <tt>is</tt> before the data goes into the binary mode.

      public void setChannel(@Nonnull InputStream in, @Nonnull OutputStream out,
                                 @CheckForNull OutputStream launchLog,
                                 @CheckForNull Channel.Listener listener
      

      If somebody really passes null to that method the underlying 3-argument method will fail with NPE. Although I think that loggers should be always passed, I think that the valid fix would be to have null handling so that API users do not get into the same risk

          [JENKINS-51955] SlaveComputer#setChannel(Channel,OutputStream,Channel.Listener) may throw null in the case of valid API usages

          Oleg Nenashev created issue -
          Oleg Nenashev made changes -
          Remote Link New: This issue links to "https://github.com/jenkinsci/jenkins/pull/3489 (Web Link)" [ 20842 ]
          Oleg Nenashev made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Oleg Nenashev made changes -
          Assignee New: Oleg Nenashev [ oleg_nenashev ]
          Oleg Nenashev made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Oleg Nenashev made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]
          Oleg Nenashev made changes -
          Labels New: lts-candidate
          Oliver Gondža made changes -
          Labels Original: lts-candidate New: 2.121.2-fixed

            oleg_nenashev Oleg Nenashev
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: