Advertisement
PVS-StudioWarnings

PVS-Studio warning V597 for NSS

Nov 21st, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. SECStatus HMAC_Init(....)
  2. {
  3.   unsigned char hashed_secret[HASH_LENGTH_MAX];
  4.   ....
  5. loser:
  6.   PORT_Memset(hashed_secret, 0, sizeof hashed_secret);
  7.   if (cx->hash != NULL)
  8.     cx->hashobj->destroy(cx->hash, PR_TRUE);
  9.   return SECFailure;
  10. }
  11.  
  12. This suspicious code was found in NSS 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 'hashed_secret' buffer. The RtlSecureZeroMemory() function should be used to erase the private data. alghmac.c 87
  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
Advertisement