Commit 286e633e authored by Roel Kluin's avatar Roel Kluin Committed by David S. Miller

isdn: hfc_usb: Fix read buffer overflow

Check whether index is within bounds before testing the element.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a947c8f0
...@@ -817,8 +817,8 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish) ...@@ -817,8 +817,8 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish)
} }
/* we have a complete hdlc packet */ /* we have a complete hdlc packet */
if (finish) { if (finish) {
if ((!fifo->skbuff->data[fifo->skbuff->len - 1]) if (fifo->skbuff->len > 3 &&
&& (fifo->skbuff->len > 3)) { !fifo->skbuff->data[fifo->skbuff->len - 1]) {
if (fifon == HFCUSB_D_RX) { if (fifon == HFCUSB_D_RX) {
DBG(HFCUSB_DBG_DCHANNEL, DBG(HFCUSB_DBG_DCHANNEL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment