aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-12-19 11:03:54 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-12-19 11:03:54 +0000
commit7d0368ee3403378806dce84cb31b9a0cc389258d (patch)
tree105d4918a8b7e3adafa8e2ce42a1ad0549123110
parent226f43e757ff7a0f945f9deb0fb1481a752274bc (diff)
downloadsrc-7d0368ee3403378806dce84cb31b9a0cc389258d.tar.gz
src-7d0368ee3403378806dce84cb31b9a0cc389258d.zip
Ensure a minimum packet length before creating a mbuf in if_ure.
Sponsored by: Mellanox Technologies // NVIDIA Networking
Notes
Notes: svn path=/head/; revision=368801
-rw-r--r--sys/dev/usb/net/if_ure.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c
index d552f2c69f56..2be46371cd28 100644
--- a/sys/dev/usb/net/if_ure.c
+++ b/sys/dev/usb/net/if_ure.c
@@ -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;