Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37823635
en ru br
ALT Linux repos
S:6.2.9-alt1
5.0: 5.07-alt2
4.1: 5.07-alt2
4.0: 5.07-alt2
3.0: 5.07-alt1

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


--- 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';
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin