Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Fix off-by-one in rx packet processing



details:   https://anonhg.NetBSD.org/src/rev/e1d083805974
branches:  trunk
changeset: 318973:e1d083805974
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri May 11 10:59:30 2018 +0000
description:
Fix off-by-one in rx packet processing

diffstat:

 sys/dev/usb/if_bwfm_usb.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 8e127c1fdcc7 -r e1d083805974 sys/dev/usb/if_bwfm_usb.c
--- a/sys/dev/usb/if_bwfm_usb.c Fri May 11 09:43:59 2018 +0000
+++ b/sys/dev/usb/if_bwfm_usb.c Fri May 11 10:59:30 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwfm_usb.c,v 1.5 2018/05/11 07:41:11 maya Exp $ */
+/* $NetBSD: if_bwfm_usb.c,v 1.6 2018/05/11 10:59:30 jmcneill Exp $ */
 /* $OpenBSD: if_bwfm_usb.c,v 1.2 2017/10/15 14:55:13 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -485,7 +485,7 @@
                goto resubmit;
        len -= sizeof(*hdr);
        off += sizeof(*hdr);
-       if (len < hdr->data_offset << 2)
+       if (len <= hdr->data_offset << 2)
                goto resubmit;
        len -= hdr->data_offset << 2;
        off += hdr->data_offset << 2;



Home | Main Index | Thread Index | Old Index