Skip to content
Permalink
Browse files

IGR padhook: do not dereference SocketParam if it is NULL (it is opti…

…onal).
  • Loading branch information...
sp193 committed Jan 29, 2019
1 parent 8709ff6 commit 541d2702f6e93a0c029053b58d69be1169865057
Showing with 5 additions and 2 deletions.
  1. +5 −2 ee_core/src/padhook.c
@@ -450,8 +450,11 @@ static int Hook_scePad2CreateSocket(pad2socketparam_t *SocketParam, void *addr)
int ret;

// Make sure scePad2CreateSocket function is still available
if (SocketParam->port == 0 && SocketParam->slot == 0)
Install_PadOpen_Hook(0x00100000, 0x01ff0000, PADOPEN_CHECK);
if (SocketParam != NULL)
{ //Do only if game specified this structure, as it is optional.
if (SocketParam->port == 0 && SocketParam->slot == 0)
Install_PadOpen_Hook(0x00100000, 0x01ff0000, PADOPEN_CHECK);
}

// Call original scePad2CreateSocket function
ret = scePad2CreateSocket(SocketParam, addr);

0 comments on commit 541d270

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.