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,
ale->attribute =
GNUNET_RECLAIM_attribute_deserialize (read_ptr,
data_size - (read_ptr - data));
+ if (NULL == ale->attribute)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Failed to deserialize malformed attribute.\n");
+ GNUNET_free (ale);
+ return al;
+ }
GNUNET_CONTAINER_DLL_insert (al->list_head, al->list_tail, ale);
attr_len = GNUNET_RECLAIM_attribute_serialize_get_size (ale->attribute);
read_ptr += attr_len;