Advertisement
PVS-StudioWarnings

PVS-Studio warning V220 for OpenSSL

Nov 21st, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. void *CRYPTO_malloc(int num, const char *file, int line);
  2.  
  3. #define OPENSSL_malloc(num) \
  4.   CRYPTO_malloc((int)num,__FILE__,__LINE__)
  5.  
  6. int ec_GFp_simple_points_make_affine(....)
  7. {
  8.   BIGNUM **heap = NULL;
  9.   size_t pow2 = 0;
  10.   ....
  11.   heap = OPENSSL_malloc(pow2 * sizeof heap[0]);
  12.   ....
  13. }
  14.  
  15. This suspicious code was found in OpenSSL project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V220 Suspicious sequence of types castings: memsize -> 32-bit integer -> memsize. The value being casted: 'pow2'. ecp_smpl.c 1576
  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
Advertisement