DragonFlyBSD Kernel Audit
DF-1103 / fix.diff
← back to finding ↓ download raw
--- /tmp/orig/bus/u4b/input/uep.c	2026-07-23 11:54:56.744810000 +0000
+++ bus/u4b/input/uep.c	2026-07-23 11:57:17.676284000 +0000
@@ -223,6 +223,8 @@
 				goto tr_setup;
 
 			res = pkt_len - sc->buf_len;
+			if (res > len)
+				res = len;
 			memcpy(sc->buf + sc->buf_len, buf, res);
 			uep_process_pkt(sc, sc->buf);
 			sc->buf_len = 0;