PVS-StudioWarnings

PVS-Studio warning V597 for Poco

Nov 20th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. void MD4Engine::transform (UInt32 state[4],
  2.                            const unsigned char block[64])
  3. {
  4.   UInt32 a = state[0], b = state[1],
  5.          c = state[2], d = state[3], x[16];
  6.   decode(x, block, 64);
  7.   ....
  8.   /* Zeroize sensitive information. */
  9.   std::memset(x, 0, sizeof(x));
  10. }
  11.  
  12. This suspicious code was found in Poco project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V597 The compiler could delete the 'memset' function call, which is used to flush 'x' buffer. The RtlSecureZeroMemory() function should be used to erase the private data. Foundation md4engine.cpp 272
  15.  
  16. 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