From: Bart Polot Date: Fri, 14 Oct 2011 11:29:21 +0000 (+0000) Subject: Additional extra check for coverity 10211 X-Git-Tag: initial-import-from-subversion-38251~16515 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5abcb3f3648cc184e0b7c9960d6c35fc2703b418;p=oweals%2Fgnunet.git Additional extra check for coverity 10211 --- 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);