From 5abcb3f3648cc184e0b7c9960d6c35fc2703b418 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Fri, 14 Oct 2011 11:29:21 +0000 Subject: [PATCH] Additional extra check for coverity 10211 --- src/mesh/gnunet-service-mesh.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 1c636443b..773710611 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -698,6 +698,7 @@ send_subscribed_clients (const struct GNUNET_MessageHeader *msg, { struct GNUNET_PeerIdentity *oid; struct MeshClient *c; + struct MeshTunnel *t; MESH_TunnelNumber *tid; unsigned int count; uint16_t type; @@ -733,7 +734,13 @@ send_subscribed_clients (const struct GNUNET_MessageHeader *msg, GNUNET_break (0); return 0; } - *tid = htonl (tunnel_get (oid, ntohl(*tid))->local_tid); + t = tunnel_get (oid, ntohl(*tid)); + if (NULL == t) + { + GNUNET_break (0); + return 0; + } + *tid = htonl (t->local_tid); for (count = 0, c = clients; c != NULL; c = c->next) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: client %u\n", c->id); -- 2.25.1