PVS-StudioWarnings

PVS-Studio warning V501 for amtsdk

Nov 13th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. static void
  2. wsman_set_subscribe_options(....)
  3. {
  4.   ...
  5.   if(options->delivery_certificatethumbprint ||
  6.      options->delivery_password ||
  7.      options->delivery_password) {
  8.   ...
  9. }
  10.  
  11. The password is checked twice, while the options->delivery_username variable is not checked.
  12.  
  13. This suspicious code was found in amtsdk project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V501 There are identical sub-expressions 'options->delivery_password' to the left and to the right of the '||' operator. OpenWsmanLib wsman-client.c 631
  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