PVS-StudioWarnings

PVS-Studio warning V597 for apr

Nov 25th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. static void MD5Transform(....)
  2. {
  3.   apr_uint32_t a = state[0], b = state[1],
  4.                c = state[2], d = state[3],
  5.                tmpbuf[APR_MD5_DIGESTSIZE];
  6.   ....
  7.   if (x == tmpbuf)
  8.   {
  9.      /* Zeroize sensitive information. */
  10.      memset(tmpbuf, 0, sizeof(tmpbuf));
  11.   }
  12. }
  13.  
  14. This suspicious code was found in apr project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V597 The compiler could delete the 'memset' function call, which is used to flush 'tmpbuf' buffer. The RtlSecureZeroMemory() function should be used to erase the private data. libaprutil apr_md5.c 436
  17.  
  18. 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