-fix
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 12 Oct 2017 13:12:42 +0000 (15:12 +0200)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 12 Oct 2017 13:12:42 +0000 (15:12 +0200)
src/identity-provider/gnunet-idp.c
src/identity-provider/plugin_rest_identity_provider.c

index 0efe6eaa9da323a283b23cb15c54fdd658ae69f1..88136c1243f5af0d78e03cec5a006c821fe4eea2 100644 (file)
@@ -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,
index b6a8f3d36feda71d4bacf063694d1a889de39557..f6039722fcf6f26e18b13b2ffb884aa9d57a1f84 100644 (file)
@@ -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);