PVS-StudioWarnings

PVS-Studio warning V597 for glibc

Nov 18th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. char *
  2. __sha256_crypt_r (key, salt, buffer, buflen)
  3.      const char *key;
  4.      const char *salt;
  5.      char *buffer;
  6.      int buflen;
  7. {
  8.   ....
  9.   unsigned char temp_result[32]
  10.   ....
  11.   memset (temp_result, '\0', sizeof (temp_result));
  12.   ....
  13. }
  14.  
  15. This suspicious code was found in glibc project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V597 The compiler could delete the 'memset' function call, which is used to flush 'temp_result' buffer. The RtlSecureZeroMemory() function should be used to erase the private data. sha256-crypt.c 385
  18.  
  19. 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