Program: 48060
Project: 48060
Buggy source:
/** 
 * Creates a new EAC1InputType.
 * @param baseType DIDAuthenticationDataType
 * @throws Exception
 */
public EAC1InputType(DIDAuthenticationDataType baseType) throws Exception {
  parseCertificateDescriptionElement(baseType);
  authMap=new AuthDataMap(baseType);
  certificates=new ArrayList<>();
  for (  Element element : baseType.getAny()) {
    if (element.getLocalName().equals(CERTIFICATE)) {
      byte[] value=StringUtils.toByteArray(element.getTextContent());
      CardVerifiableCertificate cvc=new CardVerifiableCertificate(value);
      certificates.add(cvc);
    }
  }
  certificateDescription=authMap.getContentAsBytes(CERTIFICATE_DESCRIPTION);
  providerInfo=authMap.getContentAsBytes(PROVIDER_INFO);
  byte[] requiredCHATtmp=authMap.getContentAsBytes(REQUIRED_CHAT);
  byte[] optionalCHATtmp=authMap.getContentAsBytes(OPTIONAL_CHAT);
  if (requiredCHATtmp == null) {
    requiredCHATtmp=new CHAT().toByteArray();
  }
 else {
    requiredCHATtmp=fixChatValue(requiredCHATtmp);
  }
  if (optionalCHATtmp == null) {
    CardVerifiableCertificateChain certChain=new CardVerifiableCertificateChain(certificates);
    CardVerifiableCertificate terminalCert=certChain.getTerminalCertificate();
    optionalCHATtmp=terminalCert.getCHAT().toByteArray();
  }
 else {
    optionalCHATtmp=fixChatValue(optionalCHATtmp);
  }
  requiredCHAT=requiredCHATtmp;
  optionalCHAT=optionalCHATtmp;
  authenticatedAuxiliaryData=authMap.getContentAsBytes(AUTHENTICATED_AUXILIARY_DATA);
  transactionInfo=authMap.getContentAsString(TRANSACTION_INFO);
}

Fixed version (ground truth):
/** 
 * Creates a new EAC1InputType.
 * @param baseType DIDAuthenticationDataType
 * @throws Exception Thrown in cause the type iss errornous.
 */
public EAC1InputType(DIDAuthenticationDataType baseType) throws Exception {
  parseCertificateDescriptionElement(baseType);
  authMap=new AuthDataMap(baseType);
  certificates=new ArrayList<>();
  for (  Element element : baseType.getAny()) {
    if (element.getLocalName().equals(CERTIFICATE)) {
      byte[] value=StringUtils.toByteArray(element.getTextContent());
      CardVerifiableCertificate cvc=new CardVerifiableCertificate(value);
      certificates.add(cvc);
    }
  }
  certificateDescription=authMap.getContentAsBytes(CERTIFICATE_DESCRIPTION);
  providerInfo=authMap.getContentAsBytes(PROVIDER_INFO);
  byte[] requiredCHATtmp=authMap.getContentAsBytes(REQUIRED_CHAT);
  byte[] optionalCHATtmp=authMap.getContentAsBytes(OPTIONAL_CHAT);
  if (requiredCHATtmp == null) {
    requiredCHATtmp=new CHAT().toByteArray();
  }
 else {
    requiredCHATtmp=fixChatValue(requiredCHATtmp);
  }
  if (optionalCHATtmp == null) {
    CardVerifiableCertificateChain certChain=new CardVerifiableCertificateChain(certificates);
    CardVerifiableCertificate terminalCert=certChain.getTerminalCertificate();
    optionalCHATtmp=terminalCert.getCHAT().toByteArray();
  }
 else {
    optionalCHATtmp=fixChatValue(optionalCHATtmp);
  }
  requiredCHAT=requiredCHATtmp;
  optionalCHAT=optionalCHATtmp;
  authenticatedAuxiliaryData=authMap.getContentAsBytes(AUTHENTICATED_AUXILIARY_DATA);
  transactionInfo=authMap.getContentAsString(TRANSACTION_INFO);
}