Fix a buffer overflow from a long local hostname.
Obtained from: OpenBSD
This commit is contained in:
parent
75dd9c65fa
commit
f743d11975
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=68891
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user