pawn-lang / sa-mp-fixes

Includes and plugins to fix various issues in the SA:MP server that can be fixed externally, leaving the devs time for other things.
139 stars 57 forks source link

(error) array index out of bounds #178

Open flamesidgs opened 1 year ago

flamesidgs commented 1 year ago

dependencies\sa-mp-fixes\fixes.inc:17374 (error) array index out of bounds (variable "FIXES_gsPlayerPGTShown") dependencies\sa-mp-fixes\fixes.inc:17571 (error) array index out of bounds (variable "FIXES_gsPlayerPGTShown") dependencies\sa-mp-fixes\fixes.inc:17788 (error) array index out of bounds (variable "FIXES_gsPlayersIterator") I get an error on a variable that is in fixes include

Y-Less commented 1 year ago

Those errors don't make any sense. Line 17374 is:

FIXES_gsPlayerPGTShown[i][MAX_PLAYERS] = MAX_PLAYERS;

The compiler can't detect an OOB from i (defined by a loop using sizeof anyway), so it must be from MAX_PLAYERS, but the array is declared with:

FIXES_gsPlayerPGTShown[FIXES_GT_STYLE_COUNT][MAX_PLAYERS + 1];

Which is by definition large enough to index MAX_PLAYERS, because of the + 1. How is your MAX_PLAYERS declared? Have you edited anything? Any other includes before fixes.inc?