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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
--- netkit-ftp-0.17/ftp/cmds.c.longnames 2006-07-25 11:13:55.000000000 +0200
+++ netkit-ftp-0.17/ftp/cmds.c 2006-07-24 17:52:10.000000000 +0200
@@ -1057,10 +1057,9 @@
status(void)
{
int i;
-
- if (connected)
+ if (connected)
printf("Connected to %s.\n", hostname);
- else
+ else
printf("Not connected.\n");
if (!proxy) {
pswitch(1);
@@ -1081,7 +1080,7 @@
onoff(runique));
printf("Case: %s; CR stripping: %s\n",onoff(mcase),onoff(crflag));
if (ntflag) {
- printf("Ntrans: (in) %s (out) %s\n", ntin,ntout);
+ printf("Ntrans: (in) %s (out) %s\n",ntin,ntout);
}
else {
printf("Ntrans: off\n");
@@ -1948,14 +1947,14 @@
}
ntflag++;
code = ntflag;
- (void) strncpy(ntin, argv[1], 16);
- ntin[16] = '\0';
+ (void) strncpy(ntin, argv[1], NTRANS_MAX);
+ ntin[NTRANS_MAX] = '\0';
if (argc == 2) {
ntout[0] = '\0';
return;
}
- (void) strncpy(ntout, argv[2], 16);
- ntout[16] = '\0';
+ (void) strncpy(ntout, argv[2], NTRANS_MAX);
+ ntout[NTRANS_MAX] = '\0';
}
static char *
@@ -1965,10 +1964,10 @@
char *cp1, *cp2 = new;
register int i, ostop, found;
- for (ostop = 0; *(ntout + ostop) && ostop < 16; ostop++);
+ for (ostop = 0; *(ntout + ostop) && ostop < NTRANS_MAX; ostop++);
for (cp1 = name; *cp1; cp1++) {
found = 0;
- for (i = 0; *(ntin + i) && i < 16; i++) {
+ for (i = 0; *(ntin + i) && i < NTRANS_MAX; i++) {
if (*cp1 == *(ntin + i)) {
found++;
if (i < ostop) {
--- netkit-ftp-0.17/ftp/ftp.c.longnames 2006-07-25 11:13:56.000000000 +0200
+++ netkit-ftp-0.17/ftp/ftp.c 2006-07-24 17:46:14.000000000 +0200
@@ -1656,8 +1656,8 @@
int runqe;
int mcse;
int ntflg;
- char nti[17];
- char nto[17];
+ char nti[NTRANS_MAX+1];
+ char nto[NTRANS_MAX+1];
int mapflg;
char mi[MAXPATHLEN];
char mo[MAXPATHLEN];
@@ -1712,11 +1712,11 @@
mcase = op->mcse;
ip->ntflg = ntflag;
ntflag = op->ntflg;
- (void) strncpy(ip->nti, ntin, 16);
- (ip->nti)[16] = '\0'; /* shouldn't use strlen */
+ (void) strncpy(ip->nti, ntin, NTRANS_MAX);
+ (ip->nti)[NTRANS_MAX] = '\0'; /* shouldn't use strlen */
(void) strcpy(ntin, op->nti);
- (void) strncpy(ip->nto, ntout, 16);
- (ip->nto)[16] = '\0';
+ (void) strncpy(ip->nto, ntout, NTRANS_MAX);
+ (ip->nto)[NTRANS_MAX] = '\0';
(void) strcpy(ntout, op->nto);
ip->mapflg = mapflag;
mapflag = op->mapflg;
--- netkit-ftp-0.17/ftp/ftp_var.h.longnames 2006-07-25 11:13:56.000000000 +0200
+++ netkit-ftp-0.17/ftp/ftp_var.h 2006-07-24 15:49:37.000000000 +0200
@@ -42,6 +42,7 @@
#include <setjmp.h>
#include <sys/param.h>
+#define NTRANS_MAX 64
/*
* Tick counter step size.
@@ -82,8 +83,8 @@
Extern char pasv[64]; /* passive port for proxy data connection */
Extern int passivemode; /* passive mode enabled */
Extern char *altarg; /* argv[1] with no shell-like preprocessing */
-Extern char ntin[17]; /* input translation table */
-Extern char ntout[17]; /* output translation table */
+Extern char ntin[NTRANS_MAX+1]; /* input translation table */
+Extern char ntout[NTRANS_MAX+1]; /* output translation table */
Extern char mapin[MAXPATHLEN]; /* input map template */
Extern char mapout[MAXPATHLEN]; /* output map template */
Extern char typename[32]; /* name of file transfer type */
|