mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 20:30:53 +07:00
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>
This commit is contained in:
parent
a947c8f031
commit
286e633ef0
@ -817,8 +817,8 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish)
|
||||
}
|
||||
/* 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,
|
||||
|
Loading…
Reference in New Issue
Block a user