Advertisement
PVS-StudioWarnings

PVS-Studio warning V557 for MTASA

Nov 24th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. class CWaterPolySAInterface
  2. {
  3. public:
  4.     WORD m_wVertexIDs[3];
  5. };
  6.  
  7. CWaterPoly* CWaterManagerSA::CreateQuad (....)
  8. {
  9.   ....
  10.   pInterface->m_wVertexIDs [ 0 ] = pV1->GetID ();
  11.   pInterface->m_wVertexIDs [ 1 ] = pV2->GetID ();
  12.   pInterface->m_wVertexIDs [ 2 ] = pV3->GetID ();
  13.   pInterface->m_wVertexIDs [ 3 ] = pV4->GetID ();
  14.   ....
  15. }
  16.  
  17. This suspicious code was found in MTASA project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V557 Array overrun is possible. The '3' index is pointing beyond array bound. cwatermanagersa.cpp 595
  20.  
  21. 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
Advertisement