Skip to content

Commit

Permalink
restore: Fix incorrect fallback case
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
tihmstar authored and nikias committed Sep 18, 2024
1 parent 3faf292 commit 1c4e53e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/restore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1c4e53e

Please sign in to comment.