PVS-StudioWarnings

PVS-Studio warning V614 for CyaSSL

Nov 18th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. static int ProcessMessage(....)
  2. {
  3.   int rhSize;
  4.   ....
  5.   notEnough = 0;
  6.   ....
  7.   if (sslBytes >= RECORD_HEADER_SZ) {
  8.     if (GetRecordHeader(sslFrame, &rh, &rhSize) != 0) {
  9.       ....
  10.       return -1;
  11.     }
  12.   }
  13.   else
  14.     notEnough = 1;
  15.   ....
  16.   if (notEnough || rhSize > (sslBytes - RECORD_HEADER_SZ)) {
  17.     ....
  18.   }
  19.  
  20.   tmp = sslFrame + rhSize;   <<<---
  21.   ....
  22. }
  23.  
  24. This suspicious code was found in CyaSSL project by PVS-Studio static code analyzer.
  25. Warning message is:
  26. V614 Potentially uninitialized variable 'rhSize' used. sniffer.c 2255
  27.  
  28. 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