From: Nathan S. Evans Date: Tue, 21 Dec 2010 14:04:56 +0000 (+0000) Subject: possible null dereference X-Git-Tag: initial-import-from-subversion-38251~19476 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=219b776fcf4f033722cf806db9f018b292481293;p=oweals%2Fgnunet.git possible null dereference --- diff --git a/src/core/core_api_iterate_peers.c b/src/core/core_api_iterate_peers.c index d1c3828bb..6a4e7858d 100644 --- a/src/core/core_api_iterate_peers.c +++ b/src/core/core_api_iterate_peers.c @@ -71,10 +71,9 @@ receive_info (void *cls, uint16_t msize; /* Handle last message or error case, disconnect and clean up */ - msize = ntohs (msg->size); if ( (msg == NULL) || ((ntohs (msg->type) == GNUNET_MESSAGE_TYPE_CORE_ITERATE_PEERS_END) && - (msize == sizeof (struct GNUNET_MessageHeader))) ) + (ntohs (msg->size) == sizeof (struct GNUNET_MessageHeader))) ) { if (request_context->peer_cb != NULL) request_context->peer_cb (request_context->cb_cls, @@ -84,6 +83,7 @@ receive_info (void *cls, return; } + msize = ntohs (msg->size); /* Handle incorrect message type or size, disconnect and clean up */ if ( (ntohs (msg->type) != GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT) || (msize < sizeof (struct ConnectNotifyMessage)) )