summaryrefslogtreecommitdiff
blob: b6ffed04d9915083105fe8995abd4b18b546517a (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- bin/sources/dupescan.c.orig	2004-09-20 21:19:29.448018912 -0400
+++ bin/sources/dupescan.c	2004-09-20 21:20:58.484483312 -0400
@@ -51,7 +51,8 @@
   read_conf_datapath(Temp);
   sprintf(dupefile, "%s/logs/dupefile", Temp);
   
-  strcpy(dupename, argv[1]);
+  strncpy(dupename, argv[1], sizeof(dupename)-1);
+  dupename[sizeof(dupename)-1] = '\0';
   if((fp = fopen(dupefile, "r")) == NULL)
     return 0;
 
--- bin/sources/dirlogclean.c.orig	2002-11-24 08:52:14.000000000 -0500
+++ bin/sources/dirlogclean.c	2004-10-06 20:49:02.357541216 -0400
@@ -99,14 +99,16 @@
     if (argv[x][0] != '-') { } else {
       switch ( argv[x][1] ) {
         case 'r':
-	        strcpy(config_file, argv[x+1]);
+	        strncpy(config_file, argv[x+1], sizeof(config_file) - 1);
+		config_file[ sizeof(config_file) - 1 ] = '\0';
 	        break;
       }
     }
     x++;
    }
   
-   strcpy(cleanname, argv[argc-1]);
+   strncpy(cleanname, argv[argc-1], sizeof(cleanname) - 1);
+   cleanname[ sizeof(cleanname) - 1 ] = '\0';
    printf("CLEANING: %s\n", cleanname);
 
    read_conf_datapath(datapath, config_file);
--- bin/sources/formateduser.c.orig	2002-11-24 08:52:14.000000000 -0500
+++ bin/sources/formateduser.c	2004-10-06 20:51:35.995184744 -0400
@@ -238,7 +238,8 @@
     if (argv[x][0] != '-') { } else {
       switch ( argv[x][1] ) {
         case 'r':
-	        strcpy(config_file, argv[x+1]);
+	        strncpy(config_file, argv[x+1], sizeof(config_file) - 1);
+		config_file[ sizeof(config_file) - 1 ] = '\0';
 	        break;
       }
     }
@@ -246,7 +247,7 @@
    }
    
    read_conf_datapath(datapath, config_file);
-   sprintf(userfile, "%s/users/%s", datapath, argv[argc-1]);
+   snprintf(userfile, sizeof(userfile), "%s/users/%s", datapath, argv[argc-1]);
    
 
    if((fp = fopen(userfile, "r")) == NULL)