PVS-StudioWarnings

PVS-Studio warning V519 for OpenSSL

Nov 12th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. int
  2. dtls1_retransmit_message(....)
  3. {
  4.   ....
  5.   /* save current state */
  6.   saved_state.enc_write_ctx = s->enc_write_ctx;
  7.   saved_state.write_hash = s->write_hash;
  8.   saved_state.compress = s->compress;
  9.   saved_state.session = s->session;
  10.   saved_state.epoch = s->d1->w_epoch;
  11.   saved_state.epoch = s->d1->w_epoch;
  12.   ....
  13. }
  14.  
  15. This suspicious code was found in OpenSSL project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V519 The 'saved_state.epoch' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1277, 1278. d1_both.c 1278
  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