aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/plugin_rest_reclaim.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2020-03-03 13:30:53 +0100
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-03-03 13:30:53 +0100
commitcd841b66b685604a54030ead95b2d679325d5dd8 (patch)
tree12e536b26ac24fb8a042a8ad5dc14d9b2364ab82 /src/reclaim/plugin_rest_reclaim.c
parentd1bdcb2618b13c3289492347550feb3fcf1f812d (diff)
downloadgnunet-cd841b66b685604a54030ead95b2d679325d5dd8.tar.gz
gnunet-cd841b66b685604a54030ead95b2d679325d5dd8.zip
fix attestation flag rest; fix NULL ptr deref
Diffstat (limited to 'src/reclaim/plugin_rest_reclaim.c')
-rw-r--r--src/reclaim/plugin_rest_reclaim.c5
1 files changed, 4 insertions, 1 deletions
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,
964 json_object_set_new (attr_obj, "value", json_string (tmp_value)); 964 json_object_set_new (attr_obj, "value", json_string (tmp_value));
965 json_object_set_new (attr_obj, "name", json_string (attr->name)); 965 json_object_set_new (attr_obj, "name", json_string (attr->name));
966 966
967 json_object_set_new (attr_obj, "flag", json_string ("1")); 967 if (GNUNET_RECLAIM_id_is_zero (&attr->attestation))
968 json_object_set_new (attr_obj, "flag", json_string ("0"));
969 else
970 json_object_set_new (attr_obj, "flag", json_string ("1"));
968 type = GNUNET_RECLAIM_attribute_number_to_typename (attr->type); 971 type = GNUNET_RECLAIM_attribute_number_to_typename (attr->type);
969 json_object_set_new (attr_obj, "type", json_string (type)); 972 json_object_set_new (attr_obj, "type", json_string (type));
970 id_str = GNUNET_STRINGS_data_to_string_alloc (&attr->id, 973 id_str = GNUNET_STRINGS_data_to_string_alloc (&attr->id,