summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-03-27 09:50:50 +0100
committerGravatar Martin Szulecki2014-03-27 09:50:50 +0100
commitee82e861a8c942b5013accd7589cf898d1f97167 (patch)
tree7675292c96ee0b84c7ac5119901222cac0fcc934 /src
parent995f87c3df933197ae168d2f0bd4f8801edc97bb (diff)
downloadlibimobiledevice-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.
Diffstat (limited to 'src')
-rw-r--r--src/lockdown.c2
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);