com.sun.jndi.ldap.sasl.SaslOutputStream.write() throws NullPointerException if it is already closed

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 11
    • Component/s: core-libs
    • None

      In context of the issue reported in JDK-8362268, calling SaslOutputStream.write(...) on a closed SaslOutputStream instance leads to a NullPointerException like below:

      Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.ietf.jgss.GSSContext.wrap(byte[], int, int, org.ietf.jgss.MessageProp)" because "this.secCtx" is null
          at jdk.security.jgss/com.sun.security.sasl.gsskerb.GssKrb5Base.wrap(GssKrb5Base.java:140)
          at java.naming/com.sun.jndi.ldap.sasl.SaslOutputStream.write(SaslOutputStream.java:89)

      The implementation in SaslOutputStream should be updated to match the specification of OutputStream.write() which specifies an IOException to be thrown in such cases.

            Assignee:
            Jaikiran Pai
            Reporter:
            Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: