From 541d2702f6e93a0c029053b58d69be1169865057 Mon Sep 17 00:00:00 2001 From: SP193 Date: Wed, 30 Jan 2019 01:15:33 +0800 Subject: [PATCH] IGR padhook: do not dereference SocketParam if it is NULL (it is optional). --- ee_core/src/padhook.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ee_core/src/padhook.c b/ee_core/src/padhook.c index ab836b5da..d7b7827f5 100644 --- a/ee_core/src/padhook.c +++ b/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);