Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned char cleanse_ctr = 0;
- void OPENSSL_cleanse(void *ptr, size_t len)
- {
- unsigned char *p = ptr;
- size_t loop = len, ctr = cleanse_ctr;
- while(loop--)
- {
- *(p++) = (unsigned char)ctr;
- ctr += (17 + ((size_t)p & 0xF));
- }
- p=memchr(ptr, (unsigned char)ctr, len);
- if(p)
- ctr += (63 + (size_t)p);
- cleanse_ctr = (unsigned char)ctr;
- }
- void usage(void)
- {
- static unsigned char *buf=NULL,*obuf=NULL;
- ....
- problems:
- OPENSSL_cleanse(buf,sizeof(buf));
- OPENSSL_cleanse(obuf,sizeof(obuf));
- ....
- }
- This suspicious code was found in OpenSSL project by PVS-Studio static code analyzer.
- Warning message is:
- V579 The OPENSSL_cleanse function receives the pointer and its size as arguments. It is possibly a mistake. Inspect the second argument. des.c 669
- 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