PVS-StudioWarnings

PVS-Studio warning V557 for MTASA

Nov 19th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. struct
  2. {
  3.   bool    bEnabled;
  4.   long    lMax;
  5.   long    lMin;
  6.   DWORD   dwType;
  7. } axis[7];
  8.  
  9. bool CJoystickManager::IsXInputDeviceAttached ( void )
  10. {
  11.   ....
  12.   m_DevInfo.axis[6].bEnabled = 0;
  13.   m_DevInfo.axis[7].bEnabled = 0;
  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 '7' index is pointing beyond array bound. cjoystickmanager.cpp 1003
  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