Nmap Development mailing list archives

Re: nmap-6.40/osscan2.cc: 2 * bad assert statement ?


From: Jacek Wielemborek <d33tah () gmail com>
Date: Thu, 02 Jan 2014 18:03:29 +0100

02/01/2014 08:40:17 David Binderman <dcb314 () hotmail com>:
Hello there,

I just ran the static analysis checker "cppcheck" over
the source code of nmap-6.40. It said many things, including

1.

[osscan2.cc:2651]: (warning) Logical disjunction always evaluates to true:
replyNo>= 0 || replyNo < 6.

Source code is

  assert(replyNo>= 0 || replyNo < 6);

Maybe

  assert(replyNo>= 0 && replyNo < 6);

would be better code.

2.

[osscan2.cc:2696]: (warning) Logical disjunction always evaluates to true:
replyNo>= 0 || replyNo < 6.

Duplicate.

Regards

David Binderman
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Thanks, that definitely makes more sense. Committed in r32586.

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: