diff options
author | Martin Szulecki | 2014-03-27 09:50:50 +0100 |
---|---|---|
committer | Martin Szulecki | 2014-03-27 09:50:50 +0100 |
commit | ee82e861a8c942b5013accd7589cf898d1f97167 (patch) | |
tree | 7675292c96ee0b84c7ac5119901222cac0fcc934 | |
parent | 995f87c3df933197ae168d2f0bd4f8801edc97bb (diff) | |
download | libimobiledevice-ee82e861a8c942b5013accd7589cf898d1f97167.tar.gz libimobiledevice-ee82e861a8c942b5013accd7589cf898d1f97167.tar.bz2 |
lockdown: Return error if getting a lockdown value failed to fix segfault
https://github.com/libimobiledevice/libimobiledevice/issues/67
The lockdownd_get_value() function is not properly handling an error
situation. The code logic always returned success as long as the lockdown
response was properly received. Thanks to Aaron Burghardt for spotting this.
-rw-r--r-- | src/lockdown.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index 99bcbb5..9b579e8 100644 --- a/src/lockdown.c +++ b/src/lockdown.c @@ -442,6 +442,8 @@ lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *dom if (lockdown_check_result(dict, "GetValue") == RESULT_SUCCESS) { debug_info("success"); ret = LOCKDOWN_E_SUCCESS; + } else { + ret = LOCKDOWN_E_UNKNOWN_ERROR; } if (ret != LOCKDOWN_E_SUCCESS) { plist_free(dict); |