Skip to content

Commit

Permalink
IGR padhook: do not dereference SocketParam if it is NULL (it is opti…
Browse files Browse the repository at this point in the history
…onal).
  • Loading branch information
sp193 committed Jan 30, 2019
1 parent 8709ff6 commit 541d270
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ee_core/src/padhook.c
Expand Up @@ -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);
Expand Down

0 comments on commit 541d270

Please sign in to comment.