Sfoglia il codice sorgente

driver: test: fix memset out of bounds in spi_master test

Ivan Grokhotkov 7 anni fa
parent
commit
fc0c110efd
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      components/driver/test/test_spi_master.c

+ 1 - 1
components/driver/test/test_spi_master.c

@@ -579,7 +579,7 @@ TEST_CASE("SPI Master DMA test, TX and RX in different regions", "[spi]")
     ESP_LOGI(TAG, "iram: %p, dram: %p", data_iram, data_dram);
     ESP_LOGI(TAG, "drom: %p, malloc: %p", data_drom, data_malloc);
 
-    memset(trans, 0, 6*sizeof(spi_transaction_t));
+    memset(trans, 0, sizeof(trans));
 
     trans[0].length = 320*8,
     trans[0].tx_buffer = data_iram;