Advertisement
PVS-StudioWarnings

PVS-Studio warning V690 for Bitcoin

Nov 24th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. class CKey {
  2.   ....
  3.   // Copy constructor. This is necessary because of memlocking.
  4.   CKey(const CKey &secret) : fValid(secret.fValid),
  5.                              fCompressed(secret.fCompressed)
  6.   {
  7.     LockObject(vch);
  8.     memcpy(vch, secret.vch, sizeof(vch));
  9.   }
  10.   ....
  11. };
  12.  
  13. This suspicious code was found in Bitcoin project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V690 The 'CKey' class implements a copy constructor, but lacks the the '=' operator. It is dangerous to use such a class. key.h 175
  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
Advertisement