aboutsummaryrefslogtreecommitdiff
path: root/src/json
diff options
context:
space:
mode:
Diffstat (limited to 'src/json')
-rw-r--r--src/json/json_helper.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
index 99d8e5b50..6c960353d 100644
--- a/src/json/json_helper.c
+++ b/src/json/json_helper.c
@@ -192,6 +192,9 @@ parse_cspec (void *cls,
unsigned int eline;
(void) cls;
+ memset (r_cspec->currency,
+ 0,
+ sizeof (r_cspec->currency));
if (GNUNET_OK !=
GNUNET_JSON_parse (root,
gspec,
@@ -218,13 +221,20 @@ parse_cspec (void *cls,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- memset (r_cspec->currency,
- 0,
- sizeof (r_cspec->currency));
- /* FIXME: check currency consists only of legal characters! */
+ if (GNUNET_OK !=
+ TALER_check_currency (currency))
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
strcpy (r_cspec->currency,
currency);
- /* FIXME: check map is valid! */
+ if (GNUNET_OK !=
+ TALER_check_currency_scale_map (map))
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
r_cspec->name = GNUNET_strdup (name);
r_cspec->decimal_separator = GNUNET_strdup (decimal_separator);
r_cspec->map_alt_unit_names = json_incref ((json_t *) map);