File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -1437,7 +1437,7 @@ void GetGameListing (
14371437 int numPlies = board.GetCurrentPlyNumber ();
14381438 for ( int i=0 ; i<numPlies && len<bufSize; i++ )
14391439 {
1440- char moveString [ 64 ];
1440+ char moveString[MAX_MOVE_STRLEN + 1 ];
14411441 char s [64 ];
14421442 int thisLen = 0 ;
14431443 Move move = board.GetPastMove (i);
Original file line number Diff line number Diff line change 2525
2626// The Mac OS X build is basically the same as the Linux build,
2727// so I define CHENARD_LINUX as a helper for conditional compilation.
28- #define CHENARD_LINUX (defined (__linux__) || defined (__APPLE__))
28+ #if defined(__linux__) || defined(__APPLE__)
29+ # define CHENARD_LINUX 1
30+ #else
31+ # define CHENARD_LINUX 0
32+ #endif
2933
3034#if CHENARD_LINUX
3135#define stricmp strcasecmp
Original file line number Diff line number Diff line change @@ -578,7 +578,15 @@ bool GetNextPgnMove (
578578 switch (tagIndex)
579579 {
580580 case 0 : // FEN
581- strncpy (info.fen , token, sizeof (info.fen ));
581+ if (strlen (token) < sizeof (info.fen ))
582+ {
583+ strcpy (info.fen , token);
584+ }
585+ else
586+ {
587+ state = PGN_FILE_STATE_SYNTAX_ERROR;
588+ goto bail_out;
589+ }
582590 break ;
583591
584592 case 1 : // WhiteELO
You can’t perform that action at this time.
0 commit comments