diff options
author | Martin Szulecki | 2012-07-17 16:06:57 +0200 |
---|---|---|
committer | Nikias Bassen | 2012-07-17 16:06:57 +0200 |
commit | fb4a61aff5c45cb775e80e3b55d43f733b01e420 (patch) | |
tree | debb216c8990ac57b8b0264f9a3d673059ed3bf7 /src/ipsw.c | |
parent | 91a94c556245a74c0a7187388688178c11fceaa1 (diff) | |
download | idevicerestore-fb4a61aff5c45cb775e80e3b55d43f733b01e420.tar.gz idevicerestore-fb4a61aff5c45cb775e80e3b55d43f733b01e420.tar.bz2 |
ipsw: Remove downloaded file if checksum verification failed
This prevents restore attempts with corrupt firmware IPSW files.
Diffstat (limited to 'src/ipsw.c')
-rw-r--r-- | src/ipsw.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -461,6 +461,10 @@ int ipsw_download_latest_fw(plist_t version_data, const char* product, const cha res = -1; } fclose(f); + + // make sure to remove invalid files + if (res < 0) + remove(fwlfn); } else { error("ERROR: Can't open '%s' for checksum verification\n", fwlfn); res = -1; |