aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/net
diff options
context:
space:
mode:
authorPierre Pronchery <khorben@FreeBSD.org>2025-05-26 23:42:30 +0000
committerPierre Pronchery <khorben@FreeBSD.org>2025-05-29 13:07:54 +0000
commit152bb8e3020451963a3f2a8adf05f00a5222a4e5 (patch)
tree4cbc86cd6fad448b254fc06e769c1a10431a3930 /sys/dev/usb/net
parent5ed36e2e1729d6a49a65366c03fc15515967ae67 (diff)
Diffstat (limited to 'sys/dev/usb/net')
-rw-r--r--sys/dev/usb/net/if_umb.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/usb/net/if_umb.c b/sys/dev/usb/net/if_umb.c
index 50f481973be0..a7d3bb764a2b 100644
--- a/sys/dev/usb/net/if_umb.c
+++ b/sys/dev/usb/net/if_umb.c
@@ -1377,10 +1377,9 @@ umb_getinfobuf(char *in, int inlen, uint32_t offs, uint32_t sz,
{
offs = le32toh(offs);
sz = le32toh(sz);
- if (inlen >= offs + sz) {
- memset(out, 0, outlen);
+ memset(out, 0, outlen);
+ if ((uint64_t)inlen >= (uint64_t)offs + (uint64_t)sz)
memcpy(out, in + offs, MIN(sz, outlen));
- }
}
static inline int