Range-check the address family parameter passed in to the sysctl handler.

Submitted by:	ru
This commit is contained in:
hsu 2002-12-25 10:51:20 +00:00
parent 1a22b7a8aa
commit 909e09e1f0

View File

@ -1017,6 +1017,8 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
if (namelen != 3)
return ((namelen < 3) ? EISDIR : ENOTDIR);
af = name[0];
if (af > AF_MAX)
return (EINVAL);
Bzero(&w, sizeof(w));
w.w_op = name[1];
w.w_arg = name[2];