diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-11-04 11:31:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-04 11:31:59 -0500 |
commit | 286e633ef0ff5bb63c07b4516665da8004966fec (patch) | |
tree | 0d2dce58a4a44d1697ef51e603b08330344106c1 /drivers/isdn/hisax/hfc_usb.c | |
parent | a947c8f0313c0cf3691b8d8d2b9aaddf372afdcc (diff) |
isdn: hfc_usb: Fix read buffer overflow
Check whether index is within bounds before testing the element.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/hisax/hfc_usb.c')
-rw-r--r-- | drivers/isdn/hisax/hfc_usb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c index 9de54202c90c..a420b64472e3 100644 --- a/drivers/isdn/hisax/hfc_usb.c +++ b/drivers/isdn/hisax/hfc_usb.c | |||
@@ -817,8 +817,8 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish) | |||
817 | } | 817 | } |
818 | /* we have a complete hdlc packet */ | 818 | /* we have a complete hdlc packet */ |
819 | if (finish) { | 819 | if (finish) { |
820 | if ((!fifo->skbuff->data[fifo->skbuff->len - 1]) | 820 | if (fifo->skbuff->len > 3 && |
821 | && (fifo->skbuff->len > 3)) { | 821 | !fifo->skbuff->data[fifo->skbuff->len - 1]) { |
822 | 822 | ||
823 | if (fifon == HFCUSB_D_RX) { | 823 | if (fifon == HFCUSB_D_RX) { |
824 | DBG(HFCUSB_DBG_DCHANNEL, | 824 | DBG(HFCUSB_DBG_DCHANNEL, |