From 5635438650ef6bcad95ce675eec29a35e884f95d Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 24 Dec 1997 01:00:24 +0000 Subject: Be extra paranoid about trusting the length of the data returned by gethostbyaddr. Submitted by: Julian Assange --- sbin/umount/umount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sbin') diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c index f4951e419bde..9b4c472a772e 100644 --- a/sbin/umount/umount.c +++ b/sbin/umount/umount.c @@ -280,7 +280,7 @@ umountfs(name, typelist) memset(&saddr, 0, sizeof(saddr)); saddr.sin_family = AF_INET; saddr.sin_port = 0; - memmove(&saddr.sin_addr, hp->h_addr, hp->h_length); + memmove(&saddr.sin_addr, hp->h_addr, MIN(hp->h_length, sizeof(saddr.sin_addr))); pertry.tv_sec = 3; pertry.tv_usec = 0; so = RPC_ANYSOCK; -- cgit v1.2.3