PVS-StudioWarnings

PVS-Studio warning V597 for QT

Nov 20th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. static inline void sha1ProcessChunk(
  2.   Sha1State *state, const unsigned char *buffer)
  3. {
  4.   ....
  5.   quint8 chunkBuffer[64];
  6.   ....
  7.   #ifdef SHA1_WIPE_VARIABLES
  8.     a = b = c = d = e = 0;
  9.     memset(chunkBuffer, 0, 64);
  10.   #endif
  11. }
  12.  
  13. This suspicious code was found in QT project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V597 The compiler could delete the 'memset' function call, which is used to flush 'chunkBuffer' buffer. The RtlSecureZeroMemory() function should be used to erase the private data. sha1.cpp 191
  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