Home page logo

nmap-dev logo Nmap Development mailing list archives

Unreachable success in EchoServer.cc
From: sean rivera <rivera.shadowoftruth () gmail com>
Date: Fri, 8 Jun 2012 20:31:01 -0600

Hey all,

I was looking at the warnings in EchoServer.cc and I noticed that in
EchoServer::start() there is an unreachable line code. More specifically
the return OP_SUCCESS; will never be called, near as I can tell.

From what I can see there is a while(1) loop above that can only be broken
out of in 3 places.
Line 1454 if the calloc fails.
Line 1459 if the new client creation fails.
Line 1479 if the generate hs_server doesn't return OP_SUCCES

All three of those places return OP_FAILURE, and there is no where that one
can break out of the infinite loop to get OP_SUCCESS.

Is that OP_SUCCESS just there to quite compiler warnings about not having a
return value, or am I just missing something?

~Sean Rivera
Software Engineer.
Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]