summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd_util.c')
-rw-r--r--src/backend/taler-merchant-httpd_util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd_util.c b/src/backend/taler-merchant-httpd_util.c
index 21f10bb0..9a500184 100644
--- a/src/backend/taler-merchant-httpd_util.c
+++ b/src/backend/taler-merchant-httpd_util.c
@@ -85,6 +85,17 @@ MH_handler_hash_contract (struct TMH_RequestHandler *rh,
"missing 'contract' field");
}
+ if (GNUNET_OK != TALER_hash_json (jcontract,
+ &hc))
+ {
+ res = TMH_RESPONSE_reply_json_pack (connection,
+ MHD_HTTP_BAD_REQUEST,
+ "{s:s, s:s}",
+ "error", "invalid contract",
+ "hint", "expected object");
+ return res;
+ }
+
GNUNET_assert (GNUNET_OK ==
TALER_hash_json (jcontract,
&hc));