aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_tunnel.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-04-01 00:16:28 +0000
committerBart Polot <bart@net.in.tum.de>2014-04-01 00:16:28 +0000
commit47bf4091b60632a8389967373651e5214eaf7494 (patch)
treef67c685a9af86e017e1d2070939f94a8f3cc8286 /src/mesh/gnunet-service-mesh_tunnel.c
parent815f90100a95d02c1442a53ac6a2f423abffff90 (diff)
downloadgnunet-47bf4091b60632a8389967373651e5214eaf7494.tar.gz
gnunet-47bf4091b60632a8389967373651e5214eaf7494.zip
- don't dereference NULL tunnels
Diffstat (limited to 'src/mesh/gnunet-service-mesh_tunnel.c')
-rw-r--r--src/mesh/gnunet-service-mesh_tunnel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c
index e6de014b1..fbc18f260 100644
--- a/src/mesh/gnunet-service-mesh_tunnel.c
+++ b/src/mesh/gnunet-service-mesh_tunnel.c
@@ -2288,6 +2288,9 @@ GMT_count_connections (struct MeshTunnel3 *t)
2288 struct MeshTConnection *iter; 2288 struct MeshTConnection *iter;
2289 unsigned int count; 2289 unsigned int count;
2290 2290
2291 if (NULL == t)
2292 return 0;
2293
2291 for (count = 0, iter = t->connection_head; NULL != iter; iter = iter->next) 2294 for (count = 0, iter = t->connection_head; NULL != iter; iter = iter->next)
2292 if (MESH_CONNECTION_DESTROYED != GMC_get_state (iter->c)) 2295 if (MESH_CONNECTION_DESTROYED != GMC_get_state (iter->c))
2293 count++; 2296 count++;