gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r21483 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r21483 - gnunet/src/transport
Date: Mon, 14 May 2012 21:15:04 +0200

Author: grothoff
Date: 2012-05-14 21:15:04 +0200 (Mon, 14 May 2012)
New Revision: 21483

Modified:
   gnunet/src/transport/test_transport_api_restart_1peer.c
Log:
-fix use after free on shutdown


Modified: gnunet/src/transport/test_transport_api_restart_1peer.c
===================================================================
--- gnunet/src/transport/test_transport_api_restart_1peer.c     2012-05-14 
18:16:41 UTC (rev 21482)
+++ gnunet/src/transport/test_transport_api_restart_1peer.c     2012-05-14 
19:15:04 UTC (rev 21483)
@@ -112,7 +112,9 @@
   th = NULL;
 
   GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1);
+  p1 = NULL;
   GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
+  p2 = NULL;
 }
 
 static void
@@ -338,11 +340,13 @@
 {
   struct PeerContext *p = cls;
 
-  if (0 == memcmp (peer, &p1->id, sizeof (struct GNUNET_PeerIdentity)))
+  if ( (NULL != p1) &&
+       (0 == memcmp (peer, &p1->id, sizeof (struct GNUNET_PeerIdentity))))
   {
     p1_connected = GNUNET_NO;
   }
-  if (0 == memcmp (peer, &p2->id, sizeof (struct GNUNET_PeerIdentity)))
+  if ( (NULL != p2) &&
+       (0 == memcmp (peer, &p2->id, sizeof (struct GNUNET_PeerIdentity))))
   {
     p2_connected = GNUNET_NO;
   }




reply via email to

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