mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-06-22 12:32:28 -05:00
EXI/BBA: Add null check in CEXIETHERNET::DirectFIFOWrite
Just in case. DMAWrite calls DirectFIFOWrite with the result of a GetPointerForRange call without first checking if it's null.
This commit is contained in:
parent
31eaf1d67c
commit
95f3f8c6df
|
|
@ -435,7 +435,7 @@ void CEXIETHERNET::DirectFIFOWrite(const u8* data, u32 size)
|
|||
// GMAC instead of finagling with packet descriptors and such
|
||||
u16* tx_fifo_count = (u16*)&mBbaMem[BBA_TXFIFOCNT];
|
||||
|
||||
if (*tx_fifo_count < BBA_TXFIFO_SIZE)
|
||||
if (data != nullptr && *tx_fifo_count < BBA_TXFIFO_SIZE)
|
||||
{
|
||||
const u32 max_size = BBA_TXFIFO_SIZE - *tx_fifo_count;
|
||||
memcpy(tx_fifo.get() + *tx_fifo_count, data, std::min(size, max_size));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user