Program: 34740
Project: 34740
Buggy source:
/** 
 * Puts stream's header block into the read buffer that will be passed to the webcontainer
 * @throws CompressionException
 * @throws ProtocolException
 */
private void processCompleteHeaders(boolean isPush) throws CompressionException {
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + myID);
  }
  if (this.headerBlock != null) {
    WsByteBufferPoolManager bufManager=HttpDispatcher.getBufferManager();
    WsByteBuffer buf=bufManager.allocate(getByteCount(headerBlock));
    int firstBlockLength=headerBlock.get(0).length;
    for (    byte[] byteArray : headerBlock) {
      buf.put(byteArray);
    }
    buf.flip();
    headerBlock=null;
    boolean isFirstLineComplete=false;
    HashMap<String,String> pseudoHeaders=new HashMap<String,String>();
    ArrayList<H2HeaderField> headers=new ArrayList<H2HeaderField>();
    H2HeaderField current=null;
    boolean isFirstHeaderBlock;
    boolean isFirstHeader=true;
    boolean processTrailerHeaders=headersCompleted;
    while (buf.hasRemaining()) {
      isFirstHeaderBlock=buf.position() < firstBlockLength;
      current=(H2Headers.decodeHeader(buf,this.muxLink.getReadTable(),isFirstHeader && isFirstHeaderBlock,processTrailerHeaders && !isPush,this.muxLink.getConnectionSettings()));
      if (current == null) {
        continue;
      }
      isFirstHeader=false;
      if (!isFirstLineComplete) {
        if (current.getName().startsWith("String_Node_Str")) {
          if (pseudoHeaders.get(current.getName()) != null) {
            this.muxLink.getReadTable().setDynamicTableValidity(false);
            throw new CompressionException("String_Node_Str" + current.toString());
          }
          pseudoHeaders.put(current.getName(),current.getValue());
        }
 else {
          isFirstLineComplete=true;
          if (H2Headers.getContentLengthValue(current) > -1) {
            expectedContentLength=H2Headers.getContentLengthValue(current);
          }
          headers.add(current);
        }
      }
 else {
        if (current.getName().startsWith("String_Node_Str")) {
          this.muxLink.getReadTable().setDynamicTableValidity(false);
          throw new CompressionException("String_Node_Str" + "String_Node_Str");
        }
        if (H2Headers.getContentLengthValue(current) > -1) {
          expectedContentLength=H2Headers.getContentLengthValue(current);
        }
        headers.add(current);
      }
    }
    if ((isPush || !processTrailerHeaders) && h2HttpInboundLinkWrap.getHeadersLength() == 0) {
      this.h2HttpInboundLinkWrap.setReadHeaders(headers);
      this.h2HttpInboundLinkWrap.setReadPseudoHeaders(pseudoHeaders);
      if (pseudoHeaders.get(HpackConstants.AUTHORITY) != null) {
        muxLink.setAuthority(pseudoHeaders.get(HpackConstants.AUTHORITY));
      }
    }
  }
 else {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + myID);
    }
  }
}

Fixed version (ground truth):
/** 
 * Puts stream's header block into the read buffer that will be passed to the webcontainer
 * @throws CompressionException
 * @throws ProtocolException
 */
private void processCompleteHeaders(boolean isPush) throws CompressionException, ProtocolException {
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + myID);
  }
  if (this.headerBlock != null) {
    WsByteBufferPoolManager bufManager=HttpDispatcher.getBufferManager();
    WsByteBuffer buf=bufManager.allocate(getByteCount(headerBlock));
    int firstBlockLength=headerBlock.get(0).length;
    for (    byte[] byteArray : headerBlock) {
      buf.put(byteArray);
    }
    buf.flip();
    headerBlock=null;
    boolean isFirstLineComplete=false;
    HashMap<String,String> pseudoHeaders=new HashMap<String,String>();
    ArrayList<H2HeaderField> headers=new ArrayList<H2HeaderField>();
    H2HeaderField current=null;
    boolean isFirstHeaderBlock;
    boolean isFirstHeader=true;
    boolean processTrailerHeaders=headersCompleted;
    while (buf.hasRemaining()) {
      isFirstHeaderBlock=buf.position() < firstBlockLength;
      current=(H2Headers.decodeHeader(buf,this.muxLink.getReadTable(),isFirstHeader && isFirstHeaderBlock,processTrailerHeaders && !isPush,this.muxLink.getConnectionSettings()));
      if (current == null) {
        continue;
      }
      isFirstHeader=false;
      if (!isFirstLineComplete) {
        if (current.getName().startsWith("String_Node_Str")) {
          if (pseudoHeaders.get(current.getName()) != null) {
            this.muxLink.getReadTable().setDynamicTableValidity(false);
            throw new CompressionException("String_Node_Str" + current.toString());
          }
          pseudoHeaders.put(current.getName(),current.getValue());
        }
 else {
          isFirstLineComplete=true;
          if (H2Headers.getContentLengthValue(current) > -1) {
            expectedContentLength=H2Headers.getContentLengthValue(current);
          }
          headers.add(current);
        }
      }
 else {
        if (current.getName().startsWith("String_Node_Str")) {
          this.muxLink.getReadTable().setDynamicTableValidity(false);
          throw new CompressionException("String_Node_Str" + "String_Node_Str");
        }
        if (H2Headers.getContentLengthValue(current) > -1) {
          expectedContentLength=H2Headers.getContentLengthValue(current);
        }
        headers.add(current);
      }
    }
    if ((isPush || !processTrailerHeaders) && h2HttpInboundLinkWrap.getHeadersLength() == 0) {
      if (!isValidH2Request(pseudoHeaders)) {
        this.setContinuationFrameExpected(false);
        ProtocolException e=new ProtocolException("String_Node_Str" + myID);
        e.setConnectionError(false);
        throw e;
      }
      if (pseudoHeaders.get(HpackConstants.AUTHORITY) != null) {
        muxLink.setAuthority(pseudoHeaders.get(HpackConstants.AUTHORITY));
      }
      this.h2HttpInboundLinkWrap.setReadHeaders(headers);
      this.h2HttpInboundLinkWrap.setReadPseudoHeaders(pseudoHeaders);
    }
  }
 else {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + myID);
    }
  }
}