File: 04_home.patch

package info (click to toggle)
rrootage 0.23a-15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,636 kB
  • sloc: cpp: 11,562; ansic: 3,444; xml: 2,032; makefile: 127; yacc: 124; sh: 52
file content (39 lines) | stat: -rw-r--r-- 1,147 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright (C) 2005  Miriam Ruiz <little_miry@yahoo.es>
# Copyright (C) 2005  Dafydd Harries <daf@debian.org>
# Distributed under the same license as the game. See debian/copyright.

Index: rrootage-0.23a/src/attractmanager.c
===================================================================
--- rrootage-0.23a.orig/src/attractmanager.c	2007-08-29 19:48:31.000000000 +0000
+++ rrootage-0.23a/src/attractmanager.c	2007-08-29 19:50:13.000000000 +0000
@@ -64,9 +64,14 @@
   int i, j;
   int version;
   char *tmpname;
-  char name[128];
+  char name[256];
 
   tmpname = getenv("HOME");
+  if (strlen(tmpname) + strlen(PREF_FILE) >= 255) {
+    fprintf(stderr,"Preferences filename is too long.\n");
+    initHiScore();
+    return;
+  }
   strcpy(name, tmpname);
   strcat(name, PREF_FILE);
 
@@ -95,9 +100,13 @@
   FILE *fp;
   int i, j;
   char *tmpname;
-  char name[128];
+  char name[256];
 
   tmpname = getenv("HOME");
+  if (strlen(tmpname) + strlen(PREF_FILE) >= 255) {
+    fprintf(stderr,"Preferences filename is too long.\n");
+    return;
+  }
   strcpy(name, tmpname);
   strcat(name, PREF_FILE);