Jelajahi Sumber

update(class/vendor/net/usbh_asix): ignore the remain data that len is less than 4

sakumisu 1 tahun lalu
induk
melakukan
adee4b6727
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      class/vendor/net/usbh_asix.c

+ 4 - 0
class/vendor/net/usbh_asix.c

@@ -731,6 +731,10 @@ find_class:
                 usbh_asix_eth_input(buf, len);
                 g_asix_rx_length -= (len + 4);
                 data_offset += (len + 4);
+
+                if (g_asix_rx_length < 4) {
+                    g_asix_rx_length = 0;
+                }
             }
         } else {
 #if CONFIG_USBHOST_ASIX_ETH_MAX_RX_SIZE <= (16 * 1024)