Program: 48057
Project: 48057
Buggy source:
/** 
 * Sets the body (LE, DATA, LC) of the APDU.
 * @param body Body of the APDU
 */
public final void setBody(byte[] body){
  try {
    ByteArrayInputStream bais=new ByteArrayInputStream(body);
    int length=bais.available();
    lc=-1;
    le=-1;
    data=new byte[0];
    if (length == 0) {
    }
 else     if (length == 1) {
      le=(bais.read() & 0xFF);
    }
 else     if (length < 65536) {
      int tmp=bais.read();
      if (tmp == 0) {
        if (bais.available() < 3) {
          le=((bais.read() & 0xFF) << 8) | (bais.read() & 0xFF);
        }
 else {
          lc=((bais.read() & 0xFF) << 8) | (bais.read() & 0xFF);
          data=new byte[lc];
          bais.read(data);
          if (bais.available() == 1) {
            le=(bais.read() & 0xFF);
          }
 else           if (bais.available() == 2) {
            le=((bais.read() & 0xFF) << 8) | (bais.read() & 0xFF);
          }
 else           if (bais.available() == 3) {
            if (bais.read() == 0) {
              le=((bais.read() & 0xFF) << 8) | (bais.read() & 0xFF);
            }
 else {
              throw new IllegalArgumentException("String_Node_Str");
            }
          }
 else           if (bais.available() > 3) {
            throw new IllegalArgumentException("String_Node_Str");
          }
        }
      }
 else       if (tmp > 0) {
        lc=(tmp & 0xFF);
        data=new byte[lc];
        bais.read(data);
        if (bais.available() == 1 || bais.available() == 3) {
          tmp=bais.read();
          if (tmp != 0) {
            le=(tmp & 0xFF);
          }
 else {
            le=((bais.read() & 0xFF) << 8) | (bais.read() & 0xFF);
          }
        }
 else         if (bais.available() == 2 || bais.available() > 3) {
          throw new IllegalArgumentException("String_Node_Str");
        }
      }
 else {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Sets the body (LE, DATA, LC) of the APDU.
 * @param body Body of the APDU
 */
public final void setBody(byte[] body){
  try {
    ByteArrayInputStream bais=new ByteArrayInputStream(body);
    int length=bais.available();
    lc=-1;
    le=-1;
    data=new byte[0];
    if (length == 0) {
    }
 else     if (length == 1) {
      le=(bais.read() & 0xFF);
    }
 else     if (length < 65536) {
      int tmp=bais.read();
      if (tmp == 0) {
        if (bais.available() < 3) {
          le=((bais.read() & 0xFF) << 8) | (bais.read() & 0xFF);
        }
 else {
          lc=((bais.read() & 0xFF) << 8) | (bais.read() & 0xFF);
          data=new byte[lc];
          bais.read(data);
          if (bais.available() == 1) {
            le=(bais.read() & 0xFF);
          }
 else           if (bais.available() == 2) {
            le=((bais.read() & 0xFF) << 8) | (bais.read() & 0xFF);
          }
 else           if (bais.available() == 3) {
            if (bais.read() == 0) {
              le=((bais.read() & 0xFF) << 8) | (bais.read() & 0xFF);
            }
 else {
              throw new IllegalArgumentException("String_Node_Str");
            }
          }
 else           if (bais.available() > 3) {
            throw new IllegalArgumentException("String_Node_Str");
          }
        }
      }
 else       if (tmp > 0) {
        lc=(tmp & 0xFF);
        data=new byte[lc];
        bais.read(data);
        if (bais.available() == 1) {
          setLE((byte)bais.read());
        }
 else         if (bais.available() == 3) {
          bais.read();
          setLE((short)(((bais.read() & 0xFF) << 8) | (bais.read() & 0xFF)));
        }
 else         if (bais.available() == 2 || bais.available() > 3) {
          throw new IllegalArgumentException("String_Node_Str");
        }
      }
 else {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
}