Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Correct the length of the buffer to copy into th...



details:   https://anonhg.NetBSD.org/src/rev/0b33984f6822
branches:  trunk
changeset: 844296:0b33984f6822
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Aug 11 07:58:16 2019 +0000

description:
Correct the length of the buffer to copy into the mbuf.  Spotted by
sc dying.

diffstat:

 sys/dev/usb/if_smsc.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f9ff095d5b91 -r 0b33984f6822 sys/dev/usb/if_smsc.c
--- a/sys/dev/usb/if_smsc.c     Sun Aug 11 07:12:08 2019 +0000
+++ b/sys/dev/usb/if_smsc.c     Sun Aug 11 07:58:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_smsc.c,v 1.52 2019/08/11 06:54:14 skrll Exp $       */
+/*     $NetBSD: if_smsc.c,v 1.53 2019/08/11 07:58:16 skrll Exp $       */
 
 /*     $OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.52 2019/08/11 06:54:14 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.53 2019/08/11 07:58:16 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -970,7 +970,7 @@
                }
 
                uint8_t *pktbuf = buf + ETHER_ALIGN;
-               size_t buflen = pktlen;
+               size_t buflen = pktlen - ETHER_ALIGN;
                int mbuf_flags = M_HASFCS;
                int csum_flags = 0;
                uint16_t csum_data = 0;



Home | Main Index | Thread Index | Old Index