Buggy code:
public class Gt06ProtocolDecoder extends BaseProtocolDecoder { private Long deviceId ; private final TimeZone timeZone = TimeZone . getTimeZone ( "UTC" ) ; public Gt06ProtocolDecoder ( DataManager dataManager , String protocol , Properties properties ) { } private String readImei ( ChannelBuffer buf ) { } private static final int MSG_LOGIN = 1 ; private static final int MSG_GPS = 16 ; private static final int MSG_LBS = 17 ; private static final int MSG_GPS_LBS_1 = 18 ; private static final int MSG_GPS_LBS_2 = 34 ; private static final int MSG_STATUS = 19 ; private static final int MSG_SATELLITE = 20 ; private static final int MSG_STRING = 21 ; private static final int MSG_GPS_LBS_STATUS_1 = 22 ; private static final int MSG_GPS_LBS_STATUS_2 = 38 ; private static final int MSG_LBS_PHONE = 23 ; private static final int MSG_LBS_EXTEND = 24 ; private static final int MSG_LBS_STATUS = 25 ; private static final int MSG_GPS_PHONE = 26 ; private static final int MSG_GPS_LBS_EXTEND = 30 ; private static final int MSG_COMMAND_0 = 128 ; private static final int MSG_COMMAND_1 = 129 ; private static final int MSG_COMMAND_2 = 130 ; private static void sendResponse ( Channel channel , int type , int index ) { } @ Override protected Object decode ( ChannelHandlerContext ctx , Channel channel , Object msg ) throws Exception { ChannelBuffer buf = ( ( ChannelBuffer ) ( msg ) ) ; if ( ( ( buf . readByte ( ) ) != 120 ) || ( ( buf . readByte ( ) ) != 120 ) ) { return null ; } int length = buf . readUnsignedByte ( ) ; int dataLength = length - 5 ; int type = buf . readUnsignedByte ( ) ; if ( type == ( Gt06ProtocolDecoder . MSG_LOGIN ) ) { String imei = readImei ( buf ) ; buf . readUnsignedShort ( ) ; if ( dataLength > 10 ) { int extensionBits = buf . readUnsignedShort ( ) ; int offset = ( extensionBits > > 4 ) * 36000 ; if ( ( extensionBits & 8 ) != 0 ) { offset = - offset ; } timeZone . setRawOffset ( offset ) ; } try { deviceId = getDataManager ( ) . getDeviceByImei ( imei ) . getId ( ) ; <START_BUG> buf . skipBytes ( ( dataLength - 8 ) ) ; <END_BUG> Gt06ProtocolDecoder . sendResponse ( channel , type , buf . readUnsignedShort ( ) ) ; } catch ( Exception error ) { Log . warning ( ( "Unknown<seq2seq4repair_space>device<seq2seq4repair_space>-<seq2seq4repair_space>" + imei ) ) ; } } else if ( ( ( deviceId ) != null ) && ( ( ( ( ( ( ( type == ( Gt06ProtocolDecoder . MSG_GPS ) ) || ( type == ( Gt06ProtocolDecoder . MSG_GPS_LBS_1 ) ) ) || ( type == ( Gt06ProtocolDecoder . MSG_GPS_LBS_2 ) ) ) || ( type == ( Gt06ProtocolDecoder . MSG_GPS_LBS_STATUS_1 ) ) ) || ( type == ( Gt06ProtocolDecoder . MSG_GPS_LBS_STATUS_2 ) ) ) || ( type == ( Gt06ProtocolDecoder . MSG_GPS_PHONE ) ) ) || ( type == ( Gt06ProtocolDecoder . MSG_GPS_LBS_EXTEND ) ) ) ) { Position position = new Position ( ) ; position . setDeviceId ( deviceId ) ; ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter ( getProtocol ( ) ) ; Calendar time = Calendar . getInstance ( timeZone ) ; time . clear ( ) ; time . set ( Calendar . YEAR , ( 2000 + ( buf . readUnsignedByte ( ) ) ) ) ; time . set ( Calendar . MONTH , ( ( buf . readUnsignedByte ( ) ) - 1 ) ) ; time . set ( Calendar . DAY_OF_MONTH , buf . readUnsignedByte ( ) ) ; time . set ( Calendar . HOUR_OF_DAY , buf . readUnsignedByte ( ) ) ; time . set ( Calendar . MINUTE , buf . readUnsignedByte ( ) ) ; time . set ( Calendar . SECOND , buf . readUnsignedByte ( ) ) ; position . setTime ( time . getTime ( ) ) ; int gpsLength = buf . readUnsignedByte ( ) ; extendedInfo . set ( "satellites" , ( gpsLength & 15 ) ) ; gpsLength >>= 4 ; double latitude = ( buf . readUnsignedInt ( ) ) // ( 60.0 * 30000.0 ) ; double longitude = ( buf . readUnsignedInt ( ) ) // ( 60.0 * 30000.0 ) ; position . setSpeed ( ( ( buf . readUnsignedByte ( ) ) * 0.539957 ) ) ; int union = buf . readUnsignedShort ( ) ; position . setCourse ( ( ( double ) ( union & 1023 ) ) ) ; position . setValid ( ( ( union & 4096 ) != 0 ) ) ; if ( ( union & 1024 ) == 0 ) latitude = - latitude ; if ( ( union & 2048 ) != 0 ) longitude = - longitude ; position . setLatitude ( latitude ) ; position . setLongitude ( longitude ) ; position . setAltitude ( 0.0 ) ; if ( ( union & 16384 ) != 0 ) { extendedInfo . set ( "acc" , ( ( union & 32768 ) != 0 ) ) ; } buf . skipBytes ( ( gpsLength - 12 ) ) ; if ( ( ( ( type == ( Gt06ProtocolDecoder . MSG_GPS_LBS_1 ) ) || ( type == ( Gt06ProtocolDecoder . MSG_GPS_LBS_2 ) ) ) || ( type == ( Gt06ProtocolDecoder . MSG_GPS_LBS_STATUS_1 ) ) ) || ( type == ( Gt06ProtocolDecoder . MSG_GPS_LBS_STATUS_2 ) ) ) { int lbsLength = 0 ; if ( ( type == ( Gt06ProtocolDecoder . MSG_GPS_LBS_STATUS_1 ) ) || ( type == ( Gt06ProtocolDecoder . MSG_GPS_LBS_STATUS_2 ) ) ) { lbsLength = buf . readUnsignedByte ( ) ; } extendedInfo . set ( "mcc" , buf . readUnsignedShort ( ) ) ;

Fix:
buf . skipBytes ( ( ( buf . readableBytes ( ) ) - 6 ) ) ;