summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-11-27 19:30:40 +0100
committerGravatar Martin Szulecki2010-11-27 19:30:40 +0100
commit4d7fdcc4d63dc61c9b1c4cc114604ae1f9d2e7de (patch)
treed509b537c4a06c00e6f65bdf24a7b2c873a29b00
parent243c28732e1ba7ade4772a9b203fbe193188f956 (diff)
downloadlibimobiledevice-4d7fdcc4d63dc61c9b1c4cc114604ae1f9d2e7de.tar.gz
libimobiledevice-4d7fdcc4d63dc61c9b1c4cc114604ae1f9d2e7de.tar.bz2
Add a safety check in lockdownd_client_new_with_handshake() to fix a possible crash
-rw-r--r--src/lockdown.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index edd47e5..2aba389 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -663,8 +663,11 @@ lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdown
char *host_id = NULL;
char *type = NULL;
-
ret = lockdownd_client_new(device, &client_loc, label);
+ if (LOCKDOWN_E_SUCCESS != ret) {
+ debug_info("failed to create lockdownd client.");
+ return ret;
+ }
/* perform handshake */
if (LOCKDOWN_E_SUCCESS != lockdownd_query_type(client_loc, &type)) {