diff options
| author | 2009-12-07 16:37:47 +0100 | |
|---|---|---|
| committer | 2009-12-07 19:46:42 -0800 | |
| commit | 62c23c1ccafedab1bf8bed2fb0e511462b8ab4cc (patch) | |
| tree | 10d0bbe8af419cf7ce67d82b8b82c19e3f9812f7 | |
| parent | ea45a41a7987ab1d05e2160ce831d2fcff695077 (diff) | |
| download | libimobiledevice-62c23c1ccafedab1bf8bed2fb0e511462b8ab4cc.tar.gz libimobiledevice-62c23c1ccafedab1bf8bed2fb0e511462b8ab4cc.tar.bz2 | |
fix lockdownd_pair returning success on error
This fixes a bug where lockdown_check_result() might return -1
and lockdownd_pair() still returns success.
Thanks to dborca for spotting this.
| -rw-r--r-- | src/lockdown.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index 6bf4c84..02b0024 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -755,8 +755,8 @@ lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *uuid, char *ho | |||
| 755 | if (ret != LOCKDOWN_E_SUCCESS) | 755 | if (ret != LOCKDOWN_E_SUCCESS) |
| 756 | return ret; | 756 | return ret; |
| 757 | 757 | ||
| 758 | if (lockdown_check_result(dict, "Pair") == RESULT_SUCCESS) { | 758 | if (lockdown_check_result(dict, "Pair") != RESULT_SUCCESS) { |
| 759 | ret = LOCKDOWN_E_SUCCESS; | 759 | ret = LOCKDOWN_E_PAIRING_FAILED; |
| 760 | } | 760 | } |
| 761 | plist_free(dict); | 761 | plist_free(dict); |
| 762 | dict = NULL; | 762 | dict = NULL; |
| @@ -767,7 +767,6 @@ lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *uuid, char *ho | |||
| 767 | userpref_set_device_public_key(uuid, public_key); | 767 | userpref_set_device_public_key(uuid, public_key); |
| 768 | } else { | 768 | } else { |
| 769 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: pair failure\n", __func__); | 769 | log_dbg_msg(DBGMASK_LOCKDOWND, "%s: pair failure\n", __func__); |
| 770 | ret = LOCKDOWN_E_PAIRING_FAILED; | ||
| 771 | } | 770 | } |
| 772 | free(public_key.data); | 771 | free(public_key.data); |
| 773 | return ret; | 772 | return ret; |
