fix use of uninit value on PAYBACK path in auditor

This commit is contained in:
Christian Grothoff 2017-04-16 02:16:41 +02:00
parent 1fe26d5d2e
commit be6dde89db
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -1531,6 +1531,17 @@ check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub,
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
} }
/* Check that the fees given in the transaction list and in dki match */
TALER_amount_ntoh (&tmp,
fee_dki);
if (0 !=
TALER_amount_cmp (&tmp,
fee))
{
/* Disagreement in fee structure within DB, should be impossible! */
GNUNET_break (0);
return GNUNET_SYSERR;
}
break; break;
case TALER_EXCHANGEDB_TT_REFRESH_MELT: case TALER_EXCHANGEDB_TT_REFRESH_MELT:
amount_with_fee = &tl->details.melt->amount_with_fee; amount_with_fee = &tl->details.melt->amount_with_fee;
@ -1544,6 +1555,17 @@ check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub,
GNUNET_break (0); GNUNET_break (0);
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
/* Check that the fees given in the transaction list and in dki match */
TALER_amount_ntoh (&tmp,
fee_dki);
if (0 !=
TALER_amount_cmp (&tmp,
fee))
{
/* Disagreement in fee structure within DB, should be impossible! */
GNUNET_break (0);
return GNUNET_SYSERR;
}
break; break;
case TALER_EXCHANGEDB_TT_REFUND: case TALER_EXCHANGEDB_TT_REFUND:
amount_with_fee = &tl->details.refund->refund_amount; amount_with_fee = &tl->details.refund->refund_amount;
@ -1594,6 +1616,17 @@ check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub,
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
} }
/* Check that the fees given in the transaction list and in dki match */
TALER_amount_ntoh (&tmp,
fee_dki);
if (0 !=
TALER_amount_cmp (&tmp,
fee))
{
/* Disagreement in fee structure within DB, should be impossible! */
GNUNET_break (0);
return GNUNET_SYSERR;
}
break; break;
case TALER_EXCHANGEDB_TT_PAYBACK: case TALER_EXCHANGEDB_TT_PAYBACK:
amount_with_fee = &tl->details.payback->value; amount_with_fee = &tl->details.payback->value;
@ -1608,17 +1641,6 @@ check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub,
break; break;
} }
/* Check that the fees given in the transaction list and in dki match */
TALER_amount_ntoh (&tmp,
fee_dki);
if (0 !=
TALER_amount_cmp (&tmp,
fee))
{
/* Disagreement in fee structure within DB, should be impossible! */
GNUNET_break (0);
return GNUNET_SYSERR;
}
} /* for 'tl' */ } /* for 'tl' */
/* Calculate total balance change, i.e. expenditures minus refunds */ /* Calculate total balance change, i.e. expenditures minus refunds */