aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-04-10 09:19:06 +0000
committerBart Polot <bart@net.in.tum.de>2014-04-10 09:19:06 +0000
commitfbfa7f809cf260a1b1ce9c1a02fdb79fe9aa6f7b (patch)
tree6b5b7fe5773a5820fd15af94a5ed3fe80d6fb4da /src/mesh
parent5f012e7bccf32d9a3bb9d59cdd0a86fadd2ec66c (diff)
downloadgnunet-fbfa7f809cf260a1b1ce9c1a02fdb79fe9aa6f7b.tar.gz
gnunet-fbfa7f809cf260a1b1ce9c1a02fdb79fe9aa6f7b.zip
- fix use after free
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh_connection.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c
index ad19c49b8..7c3ab33b8 100644
--- a/src/mesh/gnunet-service-mesh_connection.c
+++ b/src/mesh/gnunet-service-mesh_connection.c
@@ -579,15 +579,18 @@ message_sent (void *cls,
579 struct MeshConnectionQueue *q = cls; 579 struct MeshConnectionQueue *q = cls;
580 double usecsperbyte; 580 double usecsperbyte;
581 int forced; 581 int forced;
582 uint32_t pid;
582 583
583 LOG (GNUNET_ERROR_TYPE_DEBUG, "connection message_sent\n"); 584 LOG (GNUNET_ERROR_TYPE_DEBUG, "connection message_sent\n");
584 585
585 fc = fwd ? &c->fwd_fc : &c->bck_fc; 586 fc = fwd ? &c->fwd_fc : &c->bck_fc;
587 pid = 0;
586 LOG (GNUNET_ERROR_TYPE_DEBUG, " %ssent %s %s\n", 588 LOG (GNUNET_ERROR_TYPE_DEBUG, " %ssent %s %s\n",
587 sent ? "" : "not ", GM_f2s (fwd), GM_m2s (type)); 589 sent ? "" : "not ", GM_f2s (fwd), GM_m2s (type));
588 LOG (GNUNET_ERROR_TYPE_DEBUG, " C_P- %p %u\n", c, c->pending_messages); 590 LOG (GNUNET_ERROR_TYPE_DEBUG, " C_P- %p %u\n", c, c->pending_messages);
589 if (NULL != q) 591 if (NULL != q)
590 { 592 {
593 pid = q->pid;
591 forced = q->forced; 594 forced = q->forced;
592 if (NULL != q->cont) 595 if (NULL != q->cont)
593 { 596 {
@@ -625,7 +628,10 @@ message_sent (void *cls,
625 628
626 case GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED: 629 case GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED:
627 if (GNUNET_YES == sent) 630 if (GNUNET_YES == sent)
628 fc->last_pid_sent = q->pid; 631 {
632 GNUNET_assert (NULL != q);
633 fc->last_pid_sent = pid;
634 }
629 635
630 LOG (GNUNET_ERROR_TYPE_DEBUG, "! Q_N- %p %u\n", fc, fc->queue_n); 636 LOG (GNUNET_ERROR_TYPE_DEBUG, "! Q_N- %p %u\n", fc, fc->queue_n);
631 if (GNUNET_NO == forced) 637 if (GNUNET_NO == forced)