Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum {
- ALL_EJECTION_SEATS = -1,
- MAX_EJECTION_SEATS = 10
- };
- int eseat_status[MAX_EJECTION_SEATS];
- void
- FGControls::set_ejection_seat( int which_seat, bool val )
- {
- ....
- if ((which_seat >= 0) && (which_seat <= MAX_EJECTION_SEATS))
- {
- if ( eseat_status[which_seat] == SEAT_SAFED ||
- eseat_status[which_seat] == SEAT_FAIL )
- ....
- }
- This suspicious code was found in FlightGear project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array overrun is possible. The value of 'which_seat' index could reach 10. controls.cxx 1717
- 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