From f80a78869a3babd939f7a85ae60726f671b45c39 Mon Sep 17 00:00:00 2001 From: Link Mauve Date: Fri, 4 Sep 2026 15:32:11 +0200 Subject: [PATCH] =?UTF-8?q?HW/EXI:=20Don=E2=80=99t=20dereference=20one=20i?= =?UTF-8?q?tem=20past=20end=20of=20array?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Source/Core/Core/HW/EXI/EXI_DeviceGecko.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceGecko.cpp b/Source/Core/Core/HW/EXI/EXI_DeviceGecko.cpp index a7bf363b7b..06e90f83b0 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceGecko.cpp +++ b/Source/Core/Core/HW/EXI/EXI_DeviceGecko.cpp @@ -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())