From 5e8990bf24b1f5319d1d1d00007f02919753b175 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 17 Jul 2012 15:51:13 +0200 Subject: main: Check if IPSW exists before attempting to extract it --- src/idevicerestore.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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) { -- cgit v1.1-32-gdbae