Ensure a minimum packet length before creating a mbuf in if_ure.

Sponsored by:	Mellanox Technologies // NVIDIA Networking
This commit is contained in:
Hans Petter Selasky 2020-12-19 11:03:54 +00:00
parent 226f43e757
commit 7d0368ee34

View File

@ -711,7 +711,7 @@ ure_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
goto tr_setup;
}
if (len != 0)
if (len >= (ETHER_HDR_LEN + ETHER_CRC_LEN))
m = ure_makembuf(pc, off, len - ETHER_CRC_LEN);
else
m = NULL;