hfc_usb: fix read buffer overflow
Subsystems (2)
PATCH 2/6 hfc_usb: fix read buffer overflow
From: Roel Kluin <[email protected]>
Check whether index is within bounds before testing the element.
Signed-off-by Roel Kluin <[email protected]>
Cc Karsten Keil <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/isdn/hisax/hfc_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/isdn/hisax/hfc_usb.c renamed from drivers/isdn/hisax/hfc_usb.c~hfc_usb-fix-read-buffer-overflow +2 -2
@@ -817,8 +817,8 @@ collect_rx_frame(usb_fifo * fifo, __u8 * }/* we have a complete hdlc packet */ if (finish) { -if ((!fifo->skbuff->data[fifo->skbuff->len -1 ]) - && (fifo->skbuff->len >3 )) { +if (fifo->skbuff->len >3 && + !fifo->skbuff->data[fifo->skbuff->len -1 ]) {if (fifon ==HFCUSB_D_RX ) { DBG(HFCUSB_DBG_DCHANNEL,
_