From d6535633315016aca247d4c16c2f6662f27bf41c Mon Sep 17 00:00:00 2001 From: sean Date: Thu, 21 Jun 2012 02:02:37 +0000 Subject: [PATCH] =?UTF-8?q?Fixed=20the=20warnings=20"=20warning:=20variabl?= =?UTF-8?q?e=20=E2=80=98readbuff=E2=80=99=20set=20but=20not=20used=20[-Wun?= =?UTF-8?q?used-but-set-variable]".=20Added=20error=20handling=20in=20the?= =?UTF-8?q?=20event=20that=20readbuff=20was=20NULL.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nping/ProbeMode.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nping/ProbeMode.cc b/nping/ProbeMode.cc index 2c8c5660d..760d402be 100644 --- a/nping/ProbeMode.cc +++ b/nping/ProbeMode.cc @@ -2183,6 +2183,9 @@ void ProbeMode::probe_udpunpriv_event_handler(nsock_pool nsp, nsock_event nse, v case NSE_TYPE_READ: /* Do an actual read() of the recv data */ readbuff=nse_readbuf(nse, &readbytes); + if(readbuff==NULL){ + outFatal(QT_3, "Error: nse_readbuff failed to read in the from the probe"); + } /* Determine which target are we dealing with */ nsi_getlastcommunicationinfo(nsi, NULL, &family, NULL, (struct sockaddr*)&peer, sizeof(struct sockaddr_storage) ); if(family==AF_INET6){