diff options
author | Martin Szulecki | 2010-11-27 19:30:40 +0100 |
---|---|---|
committer | Martin Szulecki | 2010-11-27 19:34:55 +0100 |
commit | d9ed7fa82a1764c6badbe6cd98e54e04a5250cc6 (patch) | |
tree | 4d38151822e47a0fdad4cb5530dec4097ed51c6f | |
parent | 0618efe5492284b1fbdd5dc296476907f670c9dd (diff) | |
download | libimobiledevice-d9ed7fa82a1764c6badbe6cd98e54e04a5250cc6.tar.gz libimobiledevice-d9ed7fa82a1764c6badbe6cd98e54e04a5250cc6.tar.bz2 |
Add a safety check in lockdownd_client_new_with_handshake() to fix a possible crash
-rw-r--r-- | src/lockdown.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index 49a42e5..83fced2 100644 --- a/src/lockdown.c +++ b/src/lockdown.c @@ -666,8 +666,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)) { |