Skip to content

Commit

Permalink
iR5900: fix heap-buffer-overflow in recompileNextInstruction
Browse files Browse the repository at this point in the history
  • Loading branch information
oltolm authored and F0bes committed Aug 10, 2024
1 parent 2151ffc commit c7a5370
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pcsx2/x86/ix86-32/iR5900.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@ void recompileNextInstruction(bool delayslot, bool swapped_delay_slot)
g_pCurInstInfo++;

// pc might be past s_nEndBlock if the last instruction in the block is a DI.
if (pc <= s_nEndBlock)
if (pc <= s_nEndBlock && (g_pCurInstInfo + (s_nEndBlock - pc) / 4 + 1) <= s_pInstCache + s_nInstCacheSize)
{
int count;
for (u32 i = 0; i < iREGCNT_GPR; ++i)
Expand Down

0 comments on commit c7a5370

Please sign in to comment.