From b2619fbc52e9728c57c4ad6f9579327abb0bbc51 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 27 Sep 2013 17:10:13 +0200 Subject: ipsw: also check product type in ipsw_get_latest_fw to get largest major version --- src/ipsw.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/ipsw.c') diff --git a/src/ipsw.c b/src/ipsw.c index 3abda03..4f86baa 100644 --- a/src/ipsw.c +++ b/src/ipsw.c @@ -296,9 +296,12 @@ int ipsw_get_latest_fw(plist_t version_data, const char* product, char** fwurl, do { plist_dict_next_item(n1, iter, &key, &val); if (key) { - long long unsigned int v = strtoull(key, NULL, 10); - if (v > major) - major = v; + plist_t pr = plist_access_path(n1, 3, key, "MobileDeviceSoftwareVersions", product); + if (pr) { + long long unsigned int v = strtoull(key, NULL, 10); + if (v > major) + major = v; + } free(key); } } while (val); -- cgit v1.1-32-gdbae