summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-01 20:51:01 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-01 20:51:01 +0100
commit947acb7330a75e0ab6dfdcaaa6f6dc23e9f208e1 (patch)
treed4e92f119c8c8bb305dcbb28150dac922b2a4fc3
parentddf4eba34eba6e9240e476a3666a162c07b35303 (diff)
downloadsync-947acb7330a75e0ab6dfdcaaa6f6dc23e9f208e1.tar.gz
sync-947acb7330a75e0ab6dfdcaaa6f6dc23e9f208e1.tar.bz2
sync-947acb7330a75e0ab6dfdcaaa6f6dc23e9f208e1.zip
fix crash if backend returns no body
-rw-r--r--src/sync/sync-httpd_backup_post.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/sync/sync-httpd_backup_post.c b/src/sync/sync-httpd_backup_post.c
index d25d230..392675a 100644
--- a/src/sync/sync-httpd_backup_post.c
+++ b/src/sync/sync-httpd_backup_post.c
@@ -331,18 +331,18 @@ proposal_cb (void *cls,
por->hr.http_status,
(unsigned int) por->hr.ec);
GNUNET_break (0);
- bc->resp = TALER_MHD_make_json_pack ("{s:I, s:s, s:I, s:I, s:O}",
- "code",
- (json_int_t)
- TALER_EC_SYNC_PAYMENT_CREATE_BACKEND_ERROR,
- "hint",
- "Failed to setup order with merchant backend",
- "backend-ec",
- (json_int_t) por->hr.ec,
- "backend-http-status",
- (json_int_t) por->hr.http_status,
- "backend-reply",
- por->hr.reply);
+ bc->resp = TALER_MHD_make_json_pack (
+ "{s:I, s:s, s:I, s:I, s:O?}",
+ "code",
+ (json_int_t) TALER_EC_SYNC_PAYMENT_CREATE_BACKEND_ERROR,
+ "hint",
+ "Failed to setup order with merchant backend",
+ "backend-ec",
+ (json_int_t) por->hr.ec,
+ "backend-http-status",
+ (json_int_t) por->hr.http_status,
+ "backend-reply",
+ por->hr.reply);
GNUNET_assert (NULL != bc->resp);
bc->response_code = MHD_HTTP_FAILED_DEPENDENCY;
return;