diff options
| author | Warner Losh <imp@FreeBSD.org> | 1997-03-03 09:50:21 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 1997-03-03 09:50:21 +0000 |
| commit | 1ffae4a6dd37c9284d88feffcaa99a4460f7fa00 (patch) | |
| tree | c8d4649d933779408b26172288bdaa722cbd8e68 | |
| parent | ddd79a9790e7c43cfa30f6205763d3d7fe7569fc (diff) | |
Notes
| -rw-r--r-- | sbin/ping/ping.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 491cf2eb7afd..0c5ebbde77ad 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -45,7 +45,7 @@ static const char copyright[] = static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; */ static const char rcsid[] = - "$Id: ping.c,v 1.18 1997/03/02 06:32:40 imp Exp $"; + "$Id: ping.c,v 1.19 1997/03/02 20:01:13 imp Exp $"; #endif /* not lint */ /* @@ -324,6 +324,8 @@ main(argc, argv) target, hstrerror(h_errno)); to->sin_len = sizeof *to; + if (hp->h_length > sizeof(to->sin_addr)) + errx(1,"gethostbyname2 returned an illegal address"); memcpy(&to->sin_addr, hp->h_addr_list[0], sizeof to->sin_addr); (void)strncpy(hnamebuf, hp->h_name, sizeof(hnamebuf) - 1); hnamebuf[(sizeof hnamebuf) - 1] = '\0'; |
