Fix a buffer overflow from a long local hostname.

Obtained from:	OpenBSD
This commit is contained in:
kris 2000-11-19 10:08:26 +00:00
parent b9600b6040
commit 1a1517afe4
3 changed files with 6 additions and 6 deletions

View File

@ -2900,12 +2900,12 @@ cmdrc(m1, m2)
int gotmachine = 0;
int l1 = strlen(m1);
int l2 = strlen(m2);
char m1save[64];
char m1save[MAXHOSTNAMELEN];
if (skiprc)
return;
strcpy(m1save, m1);
strlcpy(m1save, m1, sizeof(m1save));
m1 = m1save;
if (rcname == 0) {

View File

@ -2900,12 +2900,12 @@ cmdrc(m1, m2)
int gotmachine = 0;
int l1 = strlen(m1);
int l2 = strlen(m2);
char m1save[64];
char m1save[MAXHOSTNAMELEN];
if (skiprc)
return;
strcpy(m1save, m1);
strlcpy(m1save, m1, sizeof(m1save));
m1 = m1save;
if (rcname == 0) {

View File

@ -2721,12 +2721,12 @@ cmdrc(m1, m2)
int gotmachine = 0;
int l1 = strlen(m1);
int l2 = strlen(m2);
char m1save[64];
char m1save[MAXHOSTNAMELEN];
if (skiprc)
return;
strcpy(m1save, m1);
strlcpy(m1save, m1, sizeof(m1save));
m1 = m1save;
if (rcname == 0) {