Program: 36058
Project: 36058
Buggy source:
@Override public void inboundBufferUpdated(ChannelHandlerContext ctx,ByteBuf buf) throws IOException {
  if (!buf.isReadable())   return;
  int service=buf.readUnsignedByte();
  ByteBuf additionalBuf=null;
  if (buf.isReadable()) {
    additionalBuf=buf.readBytes(buf.readableBytes());
  }
  ChannelPipeline pipeline=ctx.pipeline();
  pipeline.remove(HandshakeDecoder.class);
switch (service) {
case HandshakeMessage.SERVICE_LOGIN:
    pipeline.addFirst(new LoginEncoder(),new LoginDecoder());
  break;
case HandshakeMessage.SERVICE_UPDATE:
pipeline.addFirst(new FileResponseEncoder(),new UpdateStatusMessageEncoder(),new XorEncoder(),new UpdateDecoder());
break;
case HandshakeMessage.SERVICE_JAGGRAB:
pipeline.addFirst(new DelimiterBasedFrameDecoder(1024,Delimiters.lineDelimiter()),new StringDecoder(StandardCharsets.ISO_8859_1),new JaggrabDecoder());
break;
case HandshakeMessage.SERVICE_REGISTER_PERSONAL_DETAILS:
case HandshakeMessage.SERVICE_REGISTER_USERNAME:
case HandshakeMessage.SERVICE_REGISTER_COMMIT:
pipeline.addFirst(new RegisterEncoder(),new RegisterDecoder(service));
break;
case HandshakeMessage.SERVICE_AUTO_LOGIN:
pipeline.addFirst(new LoginEncoder(),new AutoLoginDecoder());
break;
case HandshakeMessage.SERVICE_WORLD_LIST:
pipeline.addFirst(new WorldListEncoder(),new WorldListDecoder());
break;
default :
throw new IOException("String_Node_Str" + service + "String_Node_Str");
}
ctx.nextInboundMessageBuffer().add(new HandshakeMessage(service));
ctx.fireInboundBufferUpdated();
if (additionalBuf != null) {
ChannelHandlerContext head=ctx.pipeline().firstContext();
head.nextInboundByteBuffer().writeBytes(additionalBuf);
head.fireInboundBufferUpdated();
}
}

Fixed version (ground truth):
@Override public void inboundBufferUpdated(ChannelHandlerContext ctx,ByteBuf buf) throws IOException {
  if (!buf.isReadable())   return;
  int service=buf.readUnsignedByte();
  ByteBuf additionalBuf=null;
  if (buf.isReadable()) {
    additionalBuf=buf.readBytes(buf.readableBytes());
  }
  ChannelPipeline pipeline=ctx.pipeline();
  pipeline.remove(HandshakeDecoder.class);
switch (service) {
case HandshakeMessage.SERVICE_LOGIN:
    pipeline.addFirst(new LoginEncoder(),new LoginDecoder());
  break;
case HandshakeMessage.SERVICE_UPDATE:
pipeline.addFirst(new FileResponseEncoder(),new UpdateStatusMessageEncoder(),new XorEncoder(),new UpdateDecoder());
break;
case HandshakeMessage.SERVICE_JAGGRAB:
pipeline.addFirst(new JaggrabEncoder(),new DelimiterBasedFrameDecoder(1024,Delimiters.lineDelimiter()),new StringDecoder(StandardCharsets.US_ASCII),new JaggrabDecoder());
break;
case HandshakeMessage.SERVICE_REGISTER_PERSONAL_DETAILS:
case HandshakeMessage.SERVICE_REGISTER_USERNAME:
case HandshakeMessage.SERVICE_REGISTER_COMMIT:
pipeline.addFirst(new RegisterEncoder(),new RegisterDecoder(service));
break;
case HandshakeMessage.SERVICE_AUTO_LOGIN:
pipeline.addFirst(new LoginEncoder(),new AutoLoginDecoder());
break;
case HandshakeMessage.SERVICE_WORLD_LIST:
pipeline.addFirst(new WorldListEncoder(),new WorldListDecoder());
break;
default :
throw new IOException("String_Node_Str" + service + "String_Node_Str");
}
ctx.nextInboundMessageBuffer().add(new HandshakeMessage(service));
ctx.fireInboundBufferUpdated();
if (additionalBuf != null) {
ChannelHandlerContext head=ctx.pipeline().firstContext();
head.nextInboundByteBuffer().writeBytes(additionalBuf);
head.fireInboundBufferUpdated();
}
}