Add code to make sure that we don't overflow the buffer that we copy
the hostname into. In theory the bind library should do this, but in practice the limites between system defines and bind defines make an attack using this vector possible. These patches have been in use on my systems for three months now, so I am fairly confident about them. I plan on commiting this to 2.2 and 2.1 in the near future, as well as many other patches of this nature.
This commit is contained in:
parent
fb9108baa9
commit
eb6c72e98f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=27511
@ -307,7 +307,10 @@ checkremote()
|
||||
"unable to get official name for local machine %s",
|
||||
name);
|
||||
return errbuf;
|
||||
} else (void) strcpy(name, hp->h_name);
|
||||
} else {
|
||||
(void) strncpy(name, hp->h_name, sizeof(name));
|
||||
name[sizeof(name) - 1] = '\0';
|
||||
}
|
||||
|
||||
/* get the official name of RM */
|
||||
hp = gethostbyname(RM);
|
||||
|
Loading…
Reference in New Issue
Block a user