mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 00:33:30 +00:00
netlink: fix OOB read in genetlink
Reported by: Coverity Scan Approved by: re (cperciva) CID: 1498863 (cherry picked from commit8f7455a926
) (cherry picked from commitd9d596bb2c
)
This commit is contained in:
parent
1af9933359
commit
4182ec5204
@ -267,7 +267,7 @@ genl_handle_message(struct nlmsghdr *hdr, struct nl_pstate *npt)
|
|||||||
|
|
||||||
int family_id = (int)hdr->nlmsg_type - GENL_MIN_ID;
|
int family_id = (int)hdr->nlmsg_type - GENL_MIN_ID;
|
||||||
|
|
||||||
if (__predict_false(family_id < 0 || family_id > MAX_FAMILIES)) {
|
if (__predict_false(family_id < 0 || family_id >= MAX_FAMILIES)) {
|
||||||
NLP_LOG(LOG_DEBUG, nlp, "invalid message type: %d", hdr->nlmsg_type);
|
NLP_LOG(LOG_DEBUG, nlp, "invalid message type: %d", hdr->nlmsg_type);
|
||||||
return (ENOTSUP);
|
return (ENOTSUP);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user