diff options
author | Nikias Bassen | 2018-04-27 20:10:25 +0200 |
---|---|---|
committer | Nikias Bassen | 2018-04-27 20:10:25 +0200 |
commit | b8b3035500eb2311aab366aaa3e5069ee422e8e3 (patch) | |
tree | e76e084ba60779d1d64418edf23eaf193513c29f | |
parent | dc484d17a2c38660afc60b23a339f82a68c2ef6e (diff) | |
download | idevicerestore-b8b3035500eb2311aab366aaa3e5069ee422e8e3.tar.gz idevicerestore-b8b3035500eb2311aab366aaa3e5069ee422e8e3.tar.bz2 |
tss: Warn about unsupported SE,ChipID value and prevent passing NULL key to plist_dict_get_item()
-rw-r--r-- | src/tss.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -734,6 +734,8 @@ int tss_request_add_se_tags(plist_t request, plist_t parameters, plist_t overrid } else if (chip_id == 0x73) { development_key = "DevelopmentUpdatePayloadHash"; production_key = "ProductionUpdatePayloadHash"; + } else { + error("WARNING: Unsupported SE,ChipID 0x%lx. Restore will likely fail.\n", (unsigned long)chip_id); } const char *key_to_remove = development_key; /* 'IsDev' determines whether we have Production or Development */ @@ -772,7 +774,7 @@ int tss_request_add_se_tags(plist_t request, plist_t parameters, plist_t overrid plist_dict_remove_item(tss_entry, "Info"); /* remove Development or Production key/hash node */ - if (plist_dict_get_item(tss_entry, key_to_remove)) { + if (key_to_remove && plist_dict_get_item(tss_entry, key_to_remove)) { plist_dict_remove_item(tss_entry, key_to_remove); } |