PVS-StudioWarnings

PVS-Studio warning V597 for Crypto++

Nov 11th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. void CAST256::Base::UncheckedSetKey(const byte *userKey,
  2.   unsigned int keylength, const NameValuePairs &)
  3. {
  4.   AssertValidKeyLength(keylength);
  5.   word32 kappa[8];
  6.   ...
  7.   memset(kappa, 0, sizeof(kappa));
  8. }
  9.  
  10. This suspicious code was found in Crypto++ project by PVS-Studio static code analyzer.
  11. Warning message is:
  12. V597 The compiler could delete the 'memset' function call, which is used to flush 'kappa' buffer. The RtlSecureZeroMemory() function should be used to erase the private data. cryptlib cast.cpp 293
  13.  
  14. 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