From: Schanzenbach, Martin Date: Thu, 12 Oct 2017 13:12:42 +0000 (+0200) Subject: -fix X-Git-Tag: gnunet-0.11.0rc0~24^2~22 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c3075f1807d794ab1fb8af4779a07f3f528ce84e;p=oweals%2Fgnunet.git -fix --- diff --git a/src/identity-provider/gnunet-idp.c b/src/identity-provider/gnunet-idp.c index 0efe6eaa9..88136c124 100644 --- a/src/identity-provider/gnunet-idp.c +++ b/src/identity-provider/gnunet-idp.c @@ -247,7 +247,7 @@ iter_finished (void *cls) attr = GNUNET_IDENTITY_PROVIDER_attribute_new (attr_name, GNUNET_IDENTITY_PROVIDER_AT_STRING, attr_value, - strlen (attr_value)); + strlen (attr_value) + 1); idp_op = GNUNET_IDENTITY_PROVIDER_attribute_store (idp_handle, pkey, attr, diff --git a/src/identity-provider/plugin_rest_identity_provider.c b/src/identity-provider/plugin_rest_identity_provider.c index b6a8f3d36..f6039722f 100644 --- a/src/identity-provider/plugin_rest_identity_provider.c +++ b/src/identity-provider/plugin_rest_identity_provider.c @@ -599,7 +599,7 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle, attribute = GNUNET_IDENTITY_PROVIDER_attribute_new (name_str, GNUNET_IDENTITY_PROVIDER_AT_STRING, value_str, - strlen (value_str)); + strlen (value_str) + 1); handle->idp = GNUNET_IDENTITY_PROVIDER_connect (cfg); handle->idp_op = GNUNET_IDENTITY_PROVIDER_attribute_store (handle->idp, identity_priv, @@ -624,6 +624,12 @@ attr_collect (void *cls, struct GNUNET_JSONAPI_Resource *json_resource; struct RequestHandle *handle = cls; json_t *value; + + if ((NULL == attr->name) || (NULL == attr->data)) + { + GNUNET_IDENTITY_PROVIDER_get_attributes_next (handle->attr_it); + return; + } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding attribute: %s\n", attr->name);