PVS-StudioWarnings

PVS-Studio warning V595 for OpenSSL

Nov 19th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #define bn_wexpand(a,words) \
  2.   (((words) <= (a)->dmax)?(a):bn_expand2((a),(words)))
  3.  
  4. static int ubsec_dh_generate_key(DH *dh)
  5. {
  6.   ....
  7.   if(bn_wexpand(pub_key, dh->p->top) == NULL) goto err;
  8.   if(pub_key == NULL) goto err;
  9.   ....
  10. }
  11.  
  12. The 'pub_key' pointer was dereferenced in bn_wexpand macros.
  13.  
  14. This suspicious code was found in OpenSSL project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V595 The 'pub_key' pointer was utilized before it was verified against nullptr. Check lines: 951, 952. e_ubsec.c 951
  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