Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAX_WEAPON_SLOTS 6 // hud item selection slots
- void CHudWeaponSelection::Paint()
- {
- ....
- int xModifiers[] = { 0, 1, 0, -1 };
- int yModifiers[] = { -1, 0, 1, 0 };
- for ( int i = 0; i < MAX_WEAPON_SLOTS; ++i )
- {
- ....
- xPos += ( m_flMediumBoxWide + 5 ) * xModifiers[ i ];
- yPos += ( m_flMediumBoxTall + 5 ) * yModifiers[ i ];
- ....
- }
- This suspicious code was found in Source SDK project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array overrun is possible. The value of 'i' index could reach 5. Client (HL2) hud_weaponselection.cpp 632
- 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