HW/EXI: Don’t dereference one item past end of array

Dolphin would previously crash while accessing &buffer[got], as if we
were trying to access that element instead of just obtaining a pointer
to it.  The proper solution is to obtain a pointer to the first element,
and only add the offset we want to get the range.

Here is the printed message:
/usr/include/c++/16/array:210: constexpr std::array<_Tp, _Nm>::value_type& std::array<_Tp, _Nm>::operator[](size_type) [with _Tp = char; long unsigned int _Nm = 128; reference = char&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.

The stack trace originates from:
Source/Core/Core/HW/EXI/EXI_DeviceGecko.cpp:139
This commit is contained in:
Link Mauve
2026-09-04 15:37:36 +02:00
parent ca8c6ee45e
commit f80a78869a
+1 -1
View File
@@ -136,7 +136,7 @@ void GeckoSockServer::ClientThread()
{
did_nothing = false;
recv_fifo.insert(recv_fifo.end(), buffer.data(), &buffer[got]);
recv_fifo.insert(recv_fifo.end(), buffer.data(), buffer.data() + got);
}
if (!send_fifo.empty())