From ee82e861a8c942b5013accd7589cf898d1f97167 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Thu, 27 Mar 2014 09:50:50 +0100 Subject: 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. --- src/lockdown.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- cgit v1.1-32-gdbae