Program: 12939
Project: 12939
Buggy source:
@EventHandler public void validateCreatedCharacterActionHandler(P132_UnknownAction action){
  LOGGER.debug("String_Node_Str");
  Session session=action.getSession();
  SessionAttachment attachment=(SessionAttachment)session.getAttachment();
  P141_UnknownAction dAction=new P141_UnknownAction();
  dAction.init(session);
  dAction.setUnknown1((short)248);
  sendAction(dAction);
  String characterName=new String(action.getUnknown1());
  byte[] appearance=action.getUnknown2();
  DBCharacter.createNewCharacter(connectionProvider,attachment.getAccountId(),characterName,appearance);
  P378_UnknownAction sAction=new P378_UnknownAction();
  sAction.init(session);
  sAction.setUnknown1(new byte[16]);
  sAction.setUnknown2(action.getUnknown1());
  sAction.setUnknown3((short)81);
  ByteBuffer buffer=ByteBuffer.allocate(100).order(ByteOrder.LITTLE_ENDIAN);
  buffer.putShort((short)6);
  buffer.putShort((short)248);
  buffer.put(new byte[]{0x33,0x36,0x31,0x30});
  buffer.put(action.getUnknown2());
  buffer.put(new byte[16]);
  buffer.put(new byte[]{0,-1,-0x23,-0x23,0,-0x23,-0x23,-0x23,-0x23});
  byte[] a=new byte[buffer.position()];
  buffer.position(0);
  buffer.get(a);
  sAction.setUnknown4(a);
  sendAction(sAction);
}

Fixed version (ground truth):
@EventHandler public void validateCreatedCharacterActionHandler(P132_UnknownAction action){
  LOGGER.debug("String_Node_Str");
  Session session=action.getSession();
  SessionAttachment attachment=(SessionAttachment)session.getAttachment();
  P141_UnknownAction dAction=new P141_UnknownAction();
  dAction.init(session);
  dAction.setUnknown1((short)248);
  sendAction(dAction);
  String characterName=new String(action.getUnknown1());
  byte[] appearance=action.getUnknown2();
  byte sex=(byte)(appearance[0] & 1);
  byte height=(byte)((appearance[0] >> 1) & 0xF);
  byte skin=(byte)(((appearance[0] >> 5) | (appearance[1] << 3)) & 0x1F);
  byte haircolor=(byte)((appearance[1] >> 2) & 0x1F);
  byte face=(byte)(((appearance[1] >> 7) | (appearance[2] << 1)) & 0x1F);
  byte primary=(byte)((appearance[2] >> 4) & 0xF);
  byte hairstyle=(byte)(appearance[3] & 0x1F);
  byte campaign=(byte)((appearance[3] >> 6) & 3);
  DBCharacter.createNewCharacter(connectionProvider,attachment.getAccountId(),characterName,sex,height,skin,haircolor,face,primary,hairstyle,campaign);
  P378_UnknownAction sAction=new P378_UnknownAction();
  sAction.init(session);
  sAction.setUnknown1(new byte[16]);
  sAction.setUnknown2(action.getUnknown1());
  sAction.setUnknown3((short)81);
  ByteBuffer buffer=ByteBuffer.allocate(100).order(ByteOrder.LITTLE_ENDIAN);
  buffer.putShort((short)6);
  buffer.putShort((short)248);
  buffer.put(new byte[]{0x33,0x36,0x31,0x30});
  buffer.put((byte)((skin << 5) | (height << 1) | sex));
  buffer.put((byte)((face << 7) | (skin >> 3)));
  buffer.put((byte)((primary << 4) | (face >> 1)));
  buffer.put((byte)((campaign << 6) | hairstyle));
  buffer.put(new byte[16]);
  byte level=0;
  buffer.put((byte)((level << 4) | campaign));
  buffer.put(new byte[]{-1,-0x23,-0x23,0,-0x23,-0x23,-0x23,-0x23});
  byte[] a=new byte[buffer.position()];
  buffer.position(0);
  buffer.get(a);
  sAction.setUnknown4(a);
  sendAction(sAction);
}