File xgalaga-2.0.34-security.patch of Package xgalaga

--- xgalaga-2.0.34.orig/highscore.c
+++ xgalaga-2.0.34/highscore.c
@@ -151,7 +151,7 @@
     close(hsf);
 
     if((home = getenv("HOME"))) {
-	sprintf(my_file_name, "%s/.xgalscores", home);
+	snprintf(my_file_name, sizeof(my_file_name)-1, "%s/.xgalscores", home);
 	hsf = open(my_file_name, O_WRONLY | O_TRUNC | O_CREAT, 0644);
 	if(hsf < 0) {
 	    printf("Couldn't write scores file %s\n", my_file_name);
@@ -395,7 +395,7 @@
     close(hsf);
 
     if((home = getenv("HOME"))) {
-	sprintf(my_file_name, "%s/.xgalscores", home);
+	snprintf(my_file_name, sizeof(my_file_name)-1, "%s/.xgalscores", home);
 	hsf = open(my_file_name, O_RDONLY);
 	if(hsf <0 ) {
 	    printf("Trouble opening high scores file '%s'\n", my_file_name);
openSUSE Build Service is sponsored by