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
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: