Properly validte arguments for route deletion
Reported by: Liang Zhuo brightiup.zhuo@gmail.com MFC after: 1 week
This commit is contained in:
parent
779520855e
commit
40bd736195
@ -1590,6 +1590,8 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
|
|||||||
switch (req) {
|
switch (req) {
|
||||||
case RTM_DELETE:
|
case RTM_DELETE:
|
||||||
if (netmask) {
|
if (netmask) {
|
||||||
|
if (dst->sa_len > sizeof(mdst))
|
||||||
|
return (EINVAL);
|
||||||
rt_maskedcopy(dst, (struct sockaddr *)&mdst, netmask);
|
rt_maskedcopy(dst, (struct sockaddr *)&mdst, netmask);
|
||||||
dst = (struct sockaddr *)&mdst;
|
dst = (struct sockaddr *)&mdst;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user