Program: 35296
Project: 35296
Buggy source:
@Override protected void decode(ChannelHandlerContext ctx,ByteBuf in,List<Object> out) throws Exception {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",ByteUtil.createString(in));
  }
  ByteBuf data;
  if (previousBuf != null) {
    CompositeByteBuf cbuf=Unpooled.compositeBuffer();
    cbuf.addComponent(previousBuf);
    cbuf.addComponent(in);
    cbuf.writerIndex(previousBuf.readableBytes() + in.readableBytes());
    data=cbuf;
    previousBuf=null;
  }
 else {
    data=in;
  }
  while (data.isReadable()) {
    if (data.readableBytes() == 1 && isSingleByteFrame(data,data.readerIndex())) {
      out.add(createSingleByteFrame(data));
    }
 else {
      boolean foundFrame=false;
      for (int searchStartIx=data.readerIndex(); searchStartIx < data.readerIndex() + data.readableBytes(); searchStartIx++) {
        if (data.getByte(searchStartIx) == DataFrame.START_OF_FRAME) {
          int frameEndIx=scanForFrame(data,searchStartIx);
          if (frameEndIx > 0) {
            if (searchStartIx > data.readerIndex() && isSingleByteFrame(data,searchStartIx - 1)) {
              data.readerIndex(searchStartIx - 1);
              out.add(createSingleByteFrame(data));
            }
 else {
              data.readerIndex(searchStartIx);
            }
            out.add(createDataFrame(data));
            data.readByte();
            foundFrame=true;
          }
        }
      }
      if (!foundFrame) {
        break;
      }
    }
  }
  if (data.readableBytes() > 0) {
    previousBuf=data;
  }
  logger.trace("String_Node_Str");
}

Fixed version (ground truth):
@Override protected void decode(ChannelHandlerContext ctx,ByteBuf in,List<Object> out) throws Exception {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",ByteUtil.createString(in));
  }
  ByteBuf data;
  if (previousBuf != null) {
    CompositeByteBuf cbuf=Unpooled.compositeBuffer(2);
    cbuf.addComponent(previousBuf.copy());
    cbuf.addComponent(in);
    cbuf.writerIndex(previousBuf.readableBytes() + in.readableBytes());
    data=cbuf;
    previousBuf.release();
    previousBuf=null;
  }
 else {
    data=in;
  }
  while (data.isReadable()) {
    if (data.readableBytes() == 1 && isSingleByteFrame(data,data.readerIndex())) {
      out.add(createSingleByteFrame(data));
    }
 else {
      boolean foundFrame=false;
      for (int searchStartIx=data.readerIndex(); searchStartIx < data.readerIndex() + data.readableBytes(); searchStartIx++) {
        if (data.getByte(searchStartIx) == DataFrame.START_OF_FRAME) {
          int frameEndIx=scanForFrame(data,searchStartIx);
          if (frameEndIx > 0) {
            if (searchStartIx > data.readerIndex() && isSingleByteFrame(data,searchStartIx - 1)) {
              data.readerIndex(searchStartIx - 1);
              out.add(createSingleByteFrame(data));
            }
 else             if (searchStartIx > data.readerIndex()) {
              data.readerIndex(searchStartIx);
            }
            out.add(createDataFrame(data));
            data.readByte();
            foundFrame=true;
          }
        }
      }
      if (!foundFrame) {
        previousBuf=data.copy();
        break;
      }
    }
  }
  in.readBytes(in.readableBytes());
  logger.trace("String_Node_Str",out);
}