mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-19 15:33:56 +00:00
Be extra paranoid about the length of data returned from gethostbyaddr or
gethostbyname. Submitted by: Julian Assange
This commit is contained in:
parent
d3a9dd61ac
commit
45b3189258
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31977
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: mail.local.c,v 1.13 1997/03/28 15:48:13 imp Exp $
|
||||
* $Id: mail.local.c,v 1.14 1997/11/13 23:14:34 alex Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -370,7 +370,7 @@ notifybiff(msg)
|
||||
return;
|
||||
}
|
||||
addr.sin_family = hp->h_addrtype;
|
||||
memmove(&addr.sin_addr, hp->h_addr, hp->h_length);
|
||||
memmove(&addr.sin_addr, hp->h_addr, MIN(hp->h_length,sizeof(addr.sin_addr)));
|
||||
addr.sin_port = sp->s_port;
|
||||
}
|
||||
if (f < 0 && (f = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user