Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CKey {
- ....
- // Copy constructor. This is necessary because of memlocking.
- CKey(const CKey &secret) : fValid(secret.fValid),
- fCompressed(secret.fCompressed)
- {
- LockObject(vch);
- memcpy(vch, secret.vch, sizeof(vch));
- }
- ....
- };
- This suspicious code was found in Bitcoin project by PVS-Studio static code analyzer.
- Warning message is:
- V690 The 'CKey' class implements a copy constructor, but lacks the the '=' operator. It is dangerous to use such a class. key.h 175
- 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