Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-643

NPE when closing telnet stream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.6
    • 3.7
    • Telnet
    • None

    Description

      our code:

      try {
                  TelnetClient telnetClient = new TelnetClient();
                  telnetClient.connect(address, port);
                  mInput = new BufferedInputStream(telnetClient.getInputStream());
                  mOutput = new PrintStream(telnetClient.getOutputStream());
                  BufferedReader br = new BufferedReader(new InputStreamReader(this.mInput));
                  ... some IO on streams ...
      } catch (IOException e) {
                  if (Dbg.DEBUG) {
                      Dbg.d(TAG, "telnet exception " + Dbg.getStackTraceString(e));
                  }
                  return false;
      } finally {
                  try {
                        if (mInput != null) mInput.close();
                        if (mOutput != null) mOutput.close();
                  } catch (IOException ignored) {}
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            einmalfel Vasily
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: