PVS-StudioWarnings

PVS-Studio warning V519 for OpenSSL

Nov 20th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #define SSL_TLSEXT_ERR_ALERT_FATAL 2
  2.  
  3. int ssl3_accept(SSL *s)
  4. {
  5.   ....
  6.   if (ret != SSL_ERROR_NONE)
  7.   {
  8.     ssl3_send_alert(s,SSL3_AL_FATAL,al);
  9.     if (al != TLS1_AD_UNKNOWN_PSK_IDENTITY)
  10.       SSLerr(SSL_F_SSL3_ACCEPT,SSL_R_CLIENTHELLO_TLSEXT);
  11.     ret = SSL_TLSEXT_ERR_ALERT_FATAL;
  12.     ret= -1;
  13.     goto end;
  14.   }
  15.   ....
  16. }
  17.  
  18. This suspicious code was found in OpenSSL project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V519 The 'ret' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 376, 377. s3_srvr.c 377
  21.  
  22. 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