Program: 29713
Project: 29713
Buggy source:
public void sendLoader() throws FileNotFoundException, IOException, X10FlashException, SinFileException {
  if (_bundle.hasLoader()) {
    SinFile sin=new SinFile(new File(_bundle.getLoader().getAbsolutePath()));
    if (sin.getVersion() >= 2)     sin.setChunkSize(0x10000);
 else     sin.setChunkSize(0x1000);
    uploadImage(sin);
    if (!_bundle.simulate()) {
      USBFlash.readS1Reply();
    }
  }
 else   logger.warn("String_Node_Str");
  if (!_bundle.simulate()) {
    hookDevice(true);
    maxS1packetsize=Integer.parseInt(phoneprops.getProperty("String_Node_Str"),16);
  }
 else   maxS1packetsize=0x080000;
  if ((maxS1packetsize / 1024) < 1024)   logger.info("String_Node_Str" + maxS1packetsize / 1024 + "String_Node_Str");
 else   logger.info("String_Node_Str" + maxS1packetsize / 1024 / 1024 + "String_Node_Str");
  if (_bundle.getMaxBuffer() == 0) {
    USBFlash.setUSBBufferSize(maxS1packetsize);
    if ((maxS1packetsize / 1024) < 1024)     logger.info("String_Node_Str" + maxS1packetsize / 1024 + "String_Node_Str");
 else     logger.info("String_Node_Str" + maxS1packetsize / 1024 / 1024 + "String_Node_Str");
  }
  if (_bundle.getMaxBuffer() == 1) {
    USBFlash.setUSBBufferSize(512 * 1024);
    logger.info("String_Node_Str");
  }
  if (_bundle.getMaxBuffer() == 2) {
    USBFlash.setUSBBufferSize(256 * 1024);
    logger.info("String_Node_Str");
  }
  if (_bundle.getMaxBuffer() == 3) {
    USBFlash.setUSBBufferSize(128 * 1024);
    logger.info("String_Node_Str");
  }
  if (_bundle.getMaxBuffer() == 4) {
    USBFlash.setUSBBufferSize(64 * 1024);
    logger.info("String_Node_Str");
  }
  if (_bundle.getMaxBuffer() == 5) {
    USBFlash.setUSBBufferSize(32 * 1024);
    logger.info("String_Node_Str");
  }
  LogProgress.initProgress(_bundle.getMaxProgress(maxS1packetsize));
}

Fixed version (ground truth):
public void sendLoader() throws FileNotFoundException, IOException, X10FlashException, SinFileException {
  if (!_bundle.hasLoader() || modded_loader) {
    if (modded_loader)     logger.info("String_Node_Str");
 else     logger.info("String_Node_Str");
    String loader=getDefaultLoader();
    if (new File(loader).exists()) {
      _bundle.setLoader(new File(loader));
    }
 else     logger.info("String_Node_Str");
  }
  if (_bundle.hasLoader()) {
    SinFile sin=new SinFile(new File(_bundle.getLoader().getAbsolutePath()));
    if (sin.getVersion() >= 2)     sin.setChunkSize(0x10000);
 else     sin.setChunkSize(0x1000);
    uploadImage(sin);
    if (!_bundle.simulate()) {
      USBFlash.readS1Reply();
    }
  }
 else   logger.warn("String_Node_Str");
  if (!_bundle.simulate()) {
    hookDevice(true);
    maxS1packetsize=Integer.parseInt(phoneprops.getProperty("String_Node_Str"),16);
  }
 else   maxS1packetsize=0x080000;
  if ((maxS1packetsize / 1024) < 1024)   logger.info("String_Node_Str" + maxS1packetsize / 1024 + "String_Node_Str");
 else   logger.info("String_Node_Str" + maxS1packetsize / 1024 / 1024 + "String_Node_Str");
  if (_bundle.getMaxBuffer() == 0) {
    USBFlash.setUSBBufferSize(maxS1packetsize);
    if ((maxS1packetsize / 1024) < 1024)     logger.info("String_Node_Str" + maxS1packetsize / 1024 + "String_Node_Str");
 else     logger.info("String_Node_Str" + maxS1packetsize / 1024 / 1024 + "String_Node_Str");
  }
  if (_bundle.getMaxBuffer() == 1) {
    USBFlash.setUSBBufferSize(512 * 1024);
    logger.info("String_Node_Str");
  }
  if (_bundle.getMaxBuffer() == 2) {
    USBFlash.setUSBBufferSize(256 * 1024);
    logger.info("String_Node_Str");
  }
  if (_bundle.getMaxBuffer() == 3) {
    USBFlash.setUSBBufferSize(128 * 1024);
    logger.info("String_Node_Str");
  }
  if (_bundle.getMaxBuffer() == 4) {
    USBFlash.setUSBBufferSize(64 * 1024);
    logger.info("String_Node_Str");
  }
  if (_bundle.getMaxBuffer() == 5) {
    USBFlash.setUSBBufferSize(32 * 1024);
    logger.info("String_Node_Str");
  }
  LogProgress.initProgress(_bundle.getMaxProgress(maxS1packetsize));
}