summaryrefslogtreecommitdiff
path: root/src/pq
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-28 20:37:19 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-28 20:37:19 +0100
commit23bc09fe3c2ca08ce209fffc0ad0ae3e51b06ef4 (patch)
tree6a9dc253ce596c247a3aac6095205f195198b8d7 /src/pq
parent8f77bda2e0297185c98694edf0d752cc925bf9a2 (diff)
downloadexchange-23bc09fe3c2ca08ce209fffc0ad0ae3e51b06ef4.tar.gz
exchange-23bc09fe3c2ca08ce209fffc0ad0ae3e51b06ef4.tar.bz2
exchange-23bc09fe3c2ca08ce209fffc0ad0ae3e51b06ef4.zip
get test-auditor and #7181 to pass
Diffstat (limited to 'src/pq')
-rw-r--r--src/pq/pq_result_helper.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pq/pq_result_helper.c b/src/pq/pq_result_helper.c
index 1115a130c..68cbbcd4c 100644
--- a/src/pq/pq_result_helper.c
+++ b/src/pq/pq_result_helper.c
@@ -97,6 +97,20 @@ extract_amount_nbo_helper (PGresult *result,
r_amount_nbo->fraction = *(uint32_t *) PQgetvalue (result,
row,
frac_num);
+ if (GNUNET_ntohll (r_amount_nbo->value) >= TALER_AMOUNT_MAX_VALUE)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Field `%s' exceeds legal range\n",
+ val_name);
+ return GNUNET_SYSERR;
+ }
+ if (ntohl (r_amount_nbo->fraction) >= TALER_AMOUNT_FRAC_BASE)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Field `%s' exceeds legal range\n",
+ frac_name);
+ return GNUNET_SYSERR;
+ }
len = GNUNET_MIN (TALER_CURRENCY_LEN - 1,
strlen (currency));
memcpy (r_amount_nbo->currency,