summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar tihmstar2024-09-17 11:01:25 +0200
committerGravatar Nikias Bassen2024-09-18 22:17:12 +0200
commit1c4e53e673a8f25033e4ad55e7c59af9308a7d7d (patch)
treee5813d3222565342e33b890655175b4fc3bcf6a8 /src
parent3faf2926aa03f5d9fd9e394fda9f88e22ae43a5b (diff)
downloadidevicerestore-1c4e53e673a8f25033e4ad55e7c59af9308a7d7d.tar.gz
idevicerestore-1c4e53e673a8f25033e4ad55e7c59af9308a7d7d.tar.bz2
restore: Fix incorrect fallback case
When the updated behavior is not triggered, the legacy behavior must be correctly executed. Thus, always correctly fall back to old behavior instead of aborting here. For example message can be NULL when restoring iOS 1.0 (in my fork).
Diffstat (limited to 'src')
-rw-r--r--src/restore.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/restore.c b/src/restore.c
index fc583c6..92e87eb 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -650,9 +650,9 @@ typedef struct restore_service_client {
static void* _restore_get_service_client_for_data_request(struct idevicerestore_client_t *client, plist_t message)
{
- if (!client || !client->restore || !client->restore->client || !PLIST_IS_DICT(message)) return NULL;
+ if (!client || !client->restore || !client->restore->client) return NULL;
restore_service_client_t service = (restore_service_client_t)malloc(sizeof(struct restore_service_client));
- if (!plist_dict_get_item(message, "DataPort")) {
+ if (!PLIST_IS_DICT(message) || !plist_dict_get_item(message, "DataPort")) {
service->client = client->restore->client;
service->type = SERVICE_TYPE_RESTORED;
return service;