From cd841b66b685604a54030ead95b2d679325d5dd8 Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Tue, 3 Mar 2020 13:30:53 +0100 Subject: fix attestation flag rest; fix NULL ptr deref --- src/reclaim/plugin_rest_reclaim.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/reclaim/plugin_rest_reclaim.c') diff --git a/src/reclaim/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c index f25241906..0246e289a 100644 --- a/src/reclaim/plugin_rest_reclaim.c +++ b/src/reclaim/plugin_rest_reclaim.c @@ -964,7 +964,10 @@ attr_collect (void *cls, json_object_set_new (attr_obj, "value", json_string (tmp_value)); json_object_set_new (attr_obj, "name", json_string (attr->name)); - json_object_set_new (attr_obj, "flag", json_string ("1")); + if (GNUNET_RECLAIM_id_is_zero (&attr->attestation)) + json_object_set_new (attr_obj, "flag", json_string ("0")); + else + json_object_set_new (attr_obj, "flag", json_string ("1")); type = GNUNET_RECLAIM_attribute_number_to_typename (attr->type); json_object_set_new (attr_obj, "type", json_string (type)); id_str = GNUNET_STRINGS_data_to_string_alloc (&attr->id, -- cgit v1.2.3