PVS-StudioWarnings

PVS-Studio warning V530 for Nmap

Nov 20th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. /** Deletes all previous field specifiers.
  2.   * This should be used when dealing
  3.   * with clients that send multiple NEP_PACKET_SPEC messages,
  4.   * so only the last PacketSpec is taken into account. */
  5. int NEPContext::resetClientFieldSpecs(){
  6.   this->fspecs.empty();
  7.   return OP_SUCCESS;
  8. } /* End of resetClientFieldSpecs() */
  9.  
  10. What a nice comment. It's a pity that the code does quite a different thing.
  11. This is what should have been written here: this->fspecs.clear();
  12.  
  13. This suspicious code was found in Nmap project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V530 The return value of function 'empty' is required to be utilized. nping nepcontext.cc 562
  16.  
  17. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment