gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r24257 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r24257 - gnunet/src/mesh
Date: Wed, 10 Oct 2012 20:54:34 +0200

Author: bartpolot
Date: 2012-10-10 20:54:34 +0200 (Wed, 10 Oct 2012)
New Revision: 24257

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
- Mark queue entry as deleted before destroying
This is to avoid queue_destroy accessing that data structure and moving the 
entries around, which causes later entries to be avoided (jumped over) and 
causes crashes on core disconnect as queue_destroy accesses the then-invalid 
tunnel structure


Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2012-10-10 17:46:56 UTC (rev 
24256)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2012-10-10 18:54:34 UTC (rev 
24257)
@@ -3192,14 +3192,17 @@
 {
   struct MeshTunnelChildInfo *cinfo = value;
   struct MeshTunnel *t = cls;
+  struct MeshPeerQueue *q;
   unsigned int c;
   unsigned int i;
 
   for (c = 0; c < cinfo->send_buffer_n; c++)
   {
     i = (cinfo->send_buffer_start + c) % t->fwd_queue_max;
-    if (NULL != cinfo->send_buffer[i])
-      queue_destroy (cinfo->send_buffer[i], GNUNET_YES);
+    q = cinfo->send_buffer[i];
+    cinfo->send_buffer[i] = NULL;
+    if (NULL != q)
+      queue_destroy (q, GNUNET_YES);
     else
       GNUNET_break (0);
     GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%u %u\n", c, cinfo->send_buffer_n);




reply via email to

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