PVS-StudioWarnings

PVS-Studio warning V557 for Doom3

Nov 12th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. static bool R_ClipLineToLight(..., const idPlane frustum[4], ...)
  2. {
  3.   ...
  4.   for ( j = 0 ; j < 6 ; j++ ) {
  5.     d1 = frustum[j].Distance( p1 );
  6.     d2 = frustum[j].Distance( p2 );
  7.     ...
  8.   }
  9.   ...
  10. }
  11.  
  12. This suspicious code was found in Doom3 project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V557 Array overrun is possible. The value of 'j' index could reach 5. DoomDLL tr_stencilshadow.cpp 551
  15.  
  16. 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