Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8203614

Java API SSLEngine example code needs correction

XMLWordPrintable

    • b08
    • Not verified

      A DESCRIPTION OF THE PROBLEM :
      Example code :
      BUFFER_UNDERFLOW:
             int netSize = engine.getSession().getPacketBufferSize();
             // Resize buffer if needed.
             if (netSize > dst.capacity()) { //**********************maybe should be :if (netSize > src.capacity()) {
                 ByteBuffer b = ByteBuffer.allocate(netSize);
                 src.flip();
                 b.put(src);
                 src = b;
             }
             // Obtain more inbound network data for src,
             // then retry the operation.
             break;
         // other cases: CLOSED, OK.

      FREQUENCY : always


            jnimeh Jamil Nimeh
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: