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

NPE when closing telnet stream

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.6
    • Fix Version/s: 3.7
    • Component/s: Telnet
    • Labels:
      None
    • Environment:

      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

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

              Dates

              • Created:
                Updated:
                Resolved: