summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2018-04-27 20:10:25 +0200
committerGravatar Nikias Bassen2018-04-27 20:10:25 +0200
commitb8b3035500eb2311aab366aaa3e5069ee422e8e3 (patch)
treee76e084ba60779d1d64418edf23eaf193513c29f
parentdc484d17a2c38660afc60b23a339f82a68c2ef6e (diff)
downloadidevicerestore-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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tss.c b/src/tss.c
index 3499662..940cd72 100644
--- a/src/tss.c
+++ b/src/tss.c
@@ -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);
}