Program: 113366
Project: 113366
Buggy source:
@Override public void startRequest(MRCRequest rq) throws Throwable {
  if (master.getReplMasterUUID() != null && !master.getReplMasterUUID().equals(master.getConfig().getUUID().toString()))   throw new DatabaseException(ExceptionType.REDIRECT);
  System.out.println(getClass() + "String_Node_Str");
  final xtreemfs_clear_vouchersRequest cvRequest=(xtreemfs_clear_vouchersRequest)rq.getRequestArgs();
  Capability cap=new Capability(cvRequest.getCreds().getXcap(),master.getConfig().getCapabilitySecret());
  Set<Long> expireTimeSet=new HashSet<Long>(cvRequest.getExpireTimeMsList());
  List<OSDFinalizeVouchersResponse> osdFinalizeVouchersResponseList=cvRequest.getOsdFinalizeVouchersResponseList();
  if (!cap.hasValidSignature())   throw new UserException(POSIXErrno.POSIX_ERROR_EPERM,cap + "String_Node_Str");
  if (cap.hasExpired())   throw new UserException(POSIXErrno.POSIX_ERROR_EPERM,cap + "String_Node_Str");
  StripingPolicy sp=cvRequest.getCreds().getXlocs().getReplicasList().get(0).getStripingPolicy();
  if (osdFinalizeVouchersResponseList.size() != sp.getWidth()) {
    throw new UserException(POSIXErrno.POSIX_ERROR_EINVAL,cvRequest + "String_Node_Str");
  }
  expireTimeSet.add(cap.getExpireMs());
  FinalizeVoucherResponseHelper responseHelper=new FinalizeVoucherResponseHelper(master.getConfig().getCapabilitySecret());
  long newFileSizeMax=-1;
  for (  OSDFinalizeVouchersResponse osdFinalizeVouchersResponse : osdFinalizeVouchersResponseList) {
    boolean valid=responseHelper.validateSignature(osdFinalizeVouchersResponse,expireTimeSet);
    if (!valid) {
      throw new UserException(POSIXErrno.POSIX_ERROR_EINVAL,osdFinalizeVouchersResponse + "String_Node_Str");
    }
    newFileSizeMax=osdFinalizeVouchersResponse.getSizeInBytes();
  }
  if (newFileSizeMax == -1) {
    throw new UserException(POSIXErrno.POSIX_ERROR_EINVAL,"String_Node_Str");
  }
  master.getMrcVoucherManager().clearVouchers(cap.getFileId(),cap.getClientIdentity(),newFileSizeMax,expireTimeSet);
  rq.setResponse(emptyResponse.getDefaultInstance());
  finishRequest(rq);
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq) throws Throwable {
  if (master.getReplMasterUUID() != null && !master.getReplMasterUUID().equals(master.getConfig().getUUID().toString()))   throw new DatabaseException(ExceptionType.REDIRECT);
  System.out.println(getClass() + "String_Node_Str");
  final xtreemfs_clear_vouchersRequest cvRequest=(xtreemfs_clear_vouchersRequest)rq.getRequestArgs();
  Capability cap=new Capability(cvRequest.getCreds().getXcap(),master.getConfig().getCapabilitySecret());
  Set<Long> expireTimeSet=new HashSet<Long>(cvRequest.getExpireTimeMsList());
  List<OSDFinalizeVouchersResponse> osdFinalizeVouchersResponseList=cvRequest.getOsdFinalizeVouchersResponseList();
  if (!cap.hasValidSignature())   throw new UserException(POSIXErrno.POSIX_ERROR_EPERM,cap + "String_Node_Str");
  if (cap.hasExpired())   throw new UserException(POSIXErrno.POSIX_ERROR_EPERM,cap + "String_Node_Str");
  StripingPolicy sp=cvRequest.getCreds().getXlocs().getReplicasList().get(0).getStripingPolicy();
  if (osdFinalizeVouchersResponseList.size() != sp.getWidth()) {
    throw new UserException(POSIXErrno.POSIX_ERROR_EINVAL,cvRequest + "String_Node_Str");
  }
  expireTimeSet.add(cap.getExpireMs());
  FinalizeVoucherResponseHelper responseHelper=new FinalizeVoucherResponseHelper(master.getConfig().getCapabilitySecret());
  long newFileSizeMax=-1;
  for (  OSDFinalizeVouchersResponse osdFinalizeVouchersResponse : osdFinalizeVouchersResponseList) {
    boolean valid=responseHelper.validateSignature(osdFinalizeVouchersResponse,expireTimeSet);
    if (!valid) {
      throw new UserException(POSIXErrno.POSIX_ERROR_EINVAL,osdFinalizeVouchersResponse + "String_Node_Str");
    }
    newFileSizeMax=osdFinalizeVouchersResponse.getSizeInBytes();
    if (osdFinalizeVouchersResponse.getSizeInBytes() > newFileSizeMax) {
      newFileSizeMax=osdFinalizeVouchersResponse.getSizeInBytes();
    }
  }
  if (newFileSizeMax == -1) {
    throw new UserException(POSIXErrno.POSIX_ERROR_EINVAL,"String_Node_Str");
  }
  master.getMrcVoucherManager().clearVouchers(cap.getFileId(),cap.getClientIdentity(),newFileSizeMax,expireTimeSet);
  rq.setResponse(emptyResponse.getDefaultInstance());
  finishRequest(rq);
}