gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated (c4e393c4a -> 2a48c70fa)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (c4e393c4a -> 2a48c70fa)
Date: Mon, 09 Oct 2017 23:12:02 +0200

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

david-barksdale pushed a change to branch master
in repository gnunet.

    from c4e393c4a Fix overflow in test_sq
     new 704722e37 Fix overflow in transport-testing
     new 9885d037e Fix memory leak in transport-testing
     new ecfb2e56f Fix use-after-free in some transport tests
     new 2a48c70fa Fix use-after-free in revalidate_address

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/transport/gnunet-service-transport_validation.c | 20 ++++++++++++++------
 src/transport/test_transport_testing_restart.c      |  3 ++-
 src/transport/test_transport_testing_startstop.c    |  3 ++-
 src/transport/transport-testing.c                   |  7 ++++++-
 4 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/src/transport/gnunet-service-transport_validation.c 
b/src/transport/gnunet-service-transport_validation.c
index 5a8539f72..27c3c7041 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -697,6 +697,7 @@ revalidate_address (void *cls)
   struct GNUNET_TIME_Relative canonical_delay;
   struct GNUNET_TIME_Relative delay;
   struct GNUNET_TIME_Relative blocked_for;
+  struct GST_BlacklistCheck *bc;
   uint32_t rdelay;
 
   ve->revalidation_task = NULL;
@@ -788,12 +789,19 @@ revalidate_address (void *cls)
     GST_blacklist_test_cancel (ve->bc);
     ve->bc = NULL;
   }
-  ve->bc = GST_blacklist_test_allowed (&ve->address->peer,
-                                       ve->address->transport_name,
-                                       &transmit_ping_if_allowed,
-                                       ve,
-                                       NULL,
-                                       NULL);
+  bc = GST_blacklist_test_allowed (&ve->address->peer,
+                                   ve->address->transport_name,
+                                   &transmit_ping_if_allowed,
+                                   ve,
+                                   NULL,
+                                   NULL);
+  if (NULL != bc)
+  {
+    /* If transmit_ping_if_allowed was already called it may have freed ve,
+     * so only set ve->bc if it has not been called.
+     */
+    ve->bc = bc;
+  }
 }
 
 
diff --git a/src/transport/test_transport_testing_restart.c 
b/src/transport/test_transport_testing_restart.c
index 595177e03..06275055d 100644
--- a/src/transport/test_transport_testing_restart.c
+++ b/src/transport/test_transport_testing_restart.c
@@ -71,7 +71,8 @@ restart_cb (void *cls)
               p->no,
               GNUNET_i2s (&p->id));
   ret = 0;
-  end ();
+  GNUNET_SCHEDULER_add_now (&end,
+                            NULL);
 }
 
 
diff --git a/src/transport/test_transport_testing_startstop.c 
b/src/transport/test_transport_testing_startstop.c
index 6ac0250cc..931e922c4 100644
--- a/src/transport/test_transport_testing_startstop.c
+++ b/src/transport/test_transport_testing_startstop.c
@@ -71,7 +71,8 @@ start_cb (void *cls)
               p->no,
               GNUNET_i2s (&p->id));
   ret = 0;
-  end ();
+  GNUNET_SCHEDULER_add_now (&end,
+                            NULL);
 }
 
 
diff --git a/src/transport/transport-testing.c 
b/src/transport/transport-testing.c
index 2aa6cdbb0..68cda3bd7 100644
--- a/src/transport/transport-testing.c
+++ b/src/transport/transport-testing.c
@@ -384,7 +384,7 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct 
GNUNET_TRANSPORT_TESTING_Handle *tth
 {
   char *emsg = NULL;
   struct GNUNET_TRANSPORT_TESTING_PeerContext *p;
-  struct GNUNET_PeerIdentity *dummy;
+  struct GNUNET_PeerIdentity dummy;
   unsigned int i;
 
   if (GNUNET_NO == GNUNET_DISK_file_test (cfgname))
@@ -678,6 +678,11 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct 
GNUNET_TRANSPORT_TESTING_PeerContext
     GNUNET_CONFIGURATION_destroy (p->cfg);
     p->cfg = NULL;
   }
+  if (NULL != p->handlers)
+  {
+    GNUNET_free (p->handlers);
+    p->handlers = NULL;
+  }
   GNUNET_CONTAINER_DLL_remove (tth->p_head,
                                tth->p_tail,
                                p);

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



reply via email to

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