Program: 27311
Project: 27311
Buggy source:
@Override public void channelRead(ChannelHandlerContext ctx,Object message) throws Exception {
  MqttMessage msg=(MqttMessage)message;
  if (msg.fixedHeader() == null) {
    throw new IOException("String_Node_Str");
  }
  MqttMessageType messageType=msg.fixedHeader().messageType();
  LOG.debug("String_Node_Str",messageType);
  try {
switch (messageType) {
case CONNECT:
      m_processor.processConnect(ctx.channel(),(MqttConnectMessage)msg);
    break;
case SUBSCRIBE:
  m_processor.processSubscribe(ctx.channel(),(MqttSubscribeMessage)msg);
break;
case UNSUBSCRIBE:
m_processor.processUnsubscribe(ctx.channel(),(MqttUnsubscribeMessage)msg);
break;
case PUBLISH:
m_processor.processPublish(ctx.channel(),(MqttPublishMessage)msg);
break;
case PUBREC:
m_processor.processPubRec(ctx.channel(),msg);
break;
case PUBCOMP:
m_processor.processPubComp(ctx.channel(),msg);
break;
case PUBREL:
m_processor.processPubRel(ctx.channel(),msg);
break;
case DISCONNECT:
m_processor.processDisconnect(ctx.channel());
break;
case PUBACK:
m_processor.processPubAck(ctx.channel(),(MqttPubAckMessage)msg);
break;
case PINGREQ:
MqttFixedHeader pingHeader=new MqttFixedHeader(MqttMessageType.PINGRESP,false,AT_MOST_ONCE,false,0);
MqttMessage pingResp=new MqttMessage(pingHeader);
ctx.writeAndFlush(pingResp).addListener(CLOSE_ON_FAILURE);
break;
default :
LOG.error("String_Node_Str",messageType);
break;
}
}
 catch (Throwable ex) {
ctx.fireExceptionCaught(ex);
}
 finally {
ReferenceCountUtil.release(msg);
}
}

Fixed version (ground truth):
@Override public void channelRead(ChannelHandlerContext ctx,Object message) throws Exception {
  MqttMessage msg=(MqttMessage)message;
  if (msg.fixedHeader() == null) {
    throw new IOException("String_Node_Str");
  }
  MqttMessageType messageType=msg.fixedHeader().messageType();
  LOG.debug("String_Node_Str",messageType);
  try {
switch (messageType) {
case CONNECT:
      m_processor.processConnect(ctx.channel(),(MqttConnectMessage)msg);
    break;
case SUBSCRIBE:
  m_processor.processSubscribe(ctx.channel(),(MqttSubscribeMessage)msg);
break;
case UNSUBSCRIBE:
m_processor.processUnsubscribe(ctx.channel(),(MqttUnsubscribeMessage)msg);
break;
case PUBLISH:
m_processor.processPublish(ctx.channel(),(MqttPublishMessage)msg);
break;
case PUBREC:
m_processor.processPubRec(ctx.channel(),msg);
break;
case PUBCOMP:
m_processor.processPubComp(ctx.channel(),msg);
break;
case PUBREL:
m_processor.processPubRel(ctx.channel(),msg);
break;
case DISCONNECT:
m_processor.processDisconnect(ctx.channel());
break;
case PUBACK:
m_processor.processPubAck(ctx.channel(),(MqttPubAckMessage)msg);
break;
case PINGREQ:
MqttFixedHeader pingHeader=new MqttFixedHeader(MqttMessageType.PINGRESP,false,AT_MOST_ONCE,false,0);
MqttMessage pingResp=new MqttMessage(pingHeader);
ctx.writeAndFlush(pingResp).addListener(CLOSE_ON_FAILURE);
break;
default :
LOG.error("String_Node_Str",messageType);
break;
}
}
 catch (Throwable ex) {
LOG.error("String_Node_Str",messageType,ex);
ctx.channel().close().addListener(new ChannelFutureListener(){
@Override public void operationComplete(ChannelFuture future){
LOG.info("String_Node_Str");
}
}
);
}
 finally {
ReferenceCountUtil.release(msg);
}
}