Group :: Games/Boards
RPM: chess
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: gnuchess-6.2.7-cve-2021-30184.patch
Download
Download
--- src/frontend/cmd.cc 2021-04-04 23:20:06.720388661 -0400
+++ src/frontend/cmd.cc 2021-04-04 23:14:35.095359251 -0400
@@ -480,8 +480,13 @@
strcpy( data, "setboard " );
int i=0;
while ( epdline[i] != '\n' ) {
- data[i+9] = epdline[i];
- ++i;
+ if ((i + 9) < MAXSTR - 1) {
+ data[i+9] = epdline[i];
+ ++i;
+ } else {
+ printf(_("Error reading contents of file '%s'.\n"), token[1]);
+ break;
+ }
}
data[i+9] = '\0';
SetDataToEngine( data );
@@ -504,8 +509,13 @@
strcpy( data, "setboard " );
int i=0;
while ( epdline[i] != '\n' ) {
- data[i+9] = epdline[i];
- ++i;
+ if ((i + 9) < MAXSTR - 1) {
+ data[i+9] = epdline[i];
+ ++i;
+ } else {
+ printf(_("Error reading contents of file '%s'.\n"), token[1]);
+ break;
+ }
}
data[i+9] = '\0';