diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-09-21 15:39:59 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-09-21 15:39:59 +0200 |
commit | 49739455b0c522a9257966dcad92a76081450009 (patch) | |
tree | 8bad74ec4a4602923bf658beee88fdaea1bdf078 /src/mint/taler-mint-httpd_refresh.c | |
parent | cf0249b4438b8859c97e5c499db1de5615e7e6ae (diff) | |
download | exchange-49739455b0c522a9257966dcad92a76081450009.tar.xz |
fix NPE if denomination key not found
Diffstat (limited to 'src/mint/taler-mint-httpd_refresh.c')
-rw-r--r-- | src/mint/taler-mint-httpd_refresh.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mint/taler-mint-httpd_refresh.c b/src/mint/taler-mint-httpd_refresh.c index bb1c570fe..72288b0a0 100644 --- a/src/mint/taler-mint-httpd_refresh.c +++ b/src/mint/taler-mint-httpd_refresh.c @@ -115,9 +115,16 @@ handle_refresh_melt_binary (struct MHD_Connection *connection, { /* calculate contribution of the i-th melt by subtracting the fee; add the rest to the total_melt value */ - dki = &TMH_KS_denomination_key_lookup (key_state, - &coin_melt_details[i].coin_info.denom_pub, - TMH_KS_DKU_DEPOSIT)->issue; + dk = TMH_KS_denomination_key_lookup (key_state, + &coin_melt_details[i].coin_info.denom_pub, + TMH_KS_DKU_DEPOSIT); + if (NULL == dk) + { + GNUNET_break (0); + return TMH_RESPONSE_reply_arg_invalid (connection, + "denom_pub"); + } + dki = &dk->issue; TALER_amount_ntoh (&fee_melt, &dki->properties.fee_refresh); if (GNUNET_OK != |