gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: fix mem corruption


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: fix mem corruption
Date: Tue, 10 Apr 2018 13:20:16 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new a51a4c046 fix mem corruption
     new 081f818a0 Merge branch 'master' of git+ssh://gnunet.org/gnunet
a51a4c046 is described below

commit a51a4c0462cef9e0bf172164837f1c1b4f73b08c
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Tue Apr 10 13:20:05 2018 +0200

    fix mem corruption
---
 src/identity-attribute/identity_attribute.c            | 11 ++++-------
 .../gnunet-service-identity-provider.c                 | 18 ++++++++++++++++--
 src/identity-provider/test_idp.conf                    |  2 +-
 3 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/src/identity-attribute/identity_attribute.c 
b/src/identity-attribute/identity_attribute.c
index 0111668fe..dc2753fca 100644
--- a/src/identity-attribute/identity_attribute.c
+++ b/src/identity-attribute/identity_attribute.c
@@ -336,18 +336,15 @@ GNUNET_IDENTITY_ATTRIBUTE_list_dup (const struct 
GNUNET_IDENTITY_ATTRIBUTE_Claim
   struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le;
   struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *result_le;
   struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *result;
-  size_t len;
 
   result = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList);
   for (le = attrs->list_head; NULL != le; le = le->next)
   {
     result_le = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry);
-    len = sizeof (struct GNUNET_IDENTITY_ATTRIBUTE_Claim) + 
le->claim->data_size;
-    result_le->claim = GNUNET_malloc (len);
-    GNUNET_memcpy (result_le->claim,
-                   le->claim,
-                   len);
-    result_le->claim->name = (const char*)&result_le->claim[1];
+    result_le->claim = GNUNET_IDENTITY_ATTRIBUTE_claim_new (le->claim->name,
+                                                     le->claim->type,
+                                                     le->claim->data,
+                                                     le->claim->data_size);
     GNUNET_CONTAINER_DLL_insert (result->list_head,
                                  result->list_tail,
                                  result_le);
diff --git a/src/identity-provider/gnunet-service-identity-provider.c 
b/src/identity-provider/gnunet-service-identity-provider.c
index a518d00ae..b738ffc82 100644
--- a/src/identity-provider/gnunet-service-identity-provider.c
+++ b/src/identity-provider/gnunet-service-identity-provider.c
@@ -1325,6 +1325,14 @@ check_attr_error (void *cls)
   cleanup_revoke_ticket_handle (rh);
 }
 
+
+/**
+ * Revoke next attribte by reencryption with
+ * new ABE master
+ */
+static void
+reenc_next_attribute (void *cls);
+
 /**
  * Check for existing attribute and overwrite
  */
@@ -1344,7 +1352,12 @@ check_attr_cb (void *cls,
   size_t buf_size;
   char* policy;
   uint32_t attr_ver;
-
+  
+  if (1 != rd_count) {
+    GNUNET_SCHEDULER_add_now (&reenc_next_attribute,
+                              rh);
+    return;
+  }
 
   buf_size = GNUNET_IDENTITY_ATTRIBUTE_serialize_get_size 
(rh->attrs->list_head->claim);
   buf = GNUNET_malloc (buf_size);
@@ -1407,8 +1420,9 @@ check_attr_cb (void *cls,
  * new ABE master
  */
 static void
-reenc_next_attribute (struct TicketRevocationHandle *rh)
+reenc_next_attribute (void *cls)
 {
+  struct TicketRevocationHandle *rh = cls;
   if (NULL == rh->attrs->list_head)
   {
     revocation_reissue_tickets (rh);
diff --git a/src/identity-provider/test_idp.conf 
b/src/identity-provider/test_idp.conf
index b11b43ae2..5480e4975 100644
--- a/src/identity-provider/test_idp.conf
+++ b/src/identity-provider/test_idp.conf
@@ -30,4 +30,4 @@ DNS_ROOT=PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0
 [identity-rest-plugin]
 address = http://localhost:8000/#/login
 psw = mysupersecretpassword
-expiration_time = 3600
\ No newline at end of file
+expiration_time = 3600

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]