summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2012-07-17 15:51:13 +0200
committerGravatar Nikias Bassen2012-07-17 15:51:13 +0200
commit5e8990bf24b1f5319d1d1d00007f02919753b175 (patch)
tree4b5812031485921882bbfcb2995672fa83008f02 /src
parent7163a720efa9f506186781b024d0ef3900636279 (diff)
downloadidevicerestore-5e8990bf24b1f5319d1d1d00007f02919753b175.tar.gz
idevicerestore-5e8990bf24b1f5319d1d1d00007f02919753b175.tar.bz2
main: Check if IPSW exists before attempting to extract it
Diffstat (limited to 'src')
-rw-r--r--src/idevicerestore.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index 3824f10..ed89ae8 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -376,6 +376,12 @@ int main(int argc, char* argv[]) {
}
}
+ // verify if ipsw file exists
+ if (access(ipsw, F_OK) < 0) {
+ error("ERROR: Firmware file %s does not exist.\n", ipsw);
+ return -1;
+ }
+
// extract buildmanifest
plist_t buildmanifest = NULL;
if (client->flags & FLAG_CUSTOM) {