diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/idevice.c | 2 | ||||
-rw-r--r-- | src/mobileactivation.c | 2 | ||||
-rw-r--r-- | src/property_list_service.c | 6 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/idevice.c b/src/idevice.c index b51f08c..18487aa 100644 --- a/src/idevice.c +++ b/src/idevice.c @@ -711,7 +711,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_receive_timeout(idevice_ *recv_bytes = 0; return IDEVICE_E_SSL_ERROR; } - + *recv_bytes = received; return IDEVICE_E_SUCCESS; } diff --git a/src/mobileactivation.c b/src/mobileactivation.c index ea891b7..2de4333 100644 --- a/src/mobileactivation.c +++ b/src/mobileactivation.c @@ -264,7 +264,7 @@ LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_create_activation plist_free(result); result = NULL; - return ret; + return ret; } LIBIMOBILEDEVICE_API mobileactivation_error_t mobileactivation_activate(mobileactivation_client_t client, plist_t activation_record) diff --git a/src/property_list_service.c b/src/property_list_service.c index f0fc830..7b5c738 100644 --- a/src/property_list_service.c +++ b/src/property_list_service.c @@ -224,6 +224,7 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis debug_info("received %d bytes", bytes); curlen += bytes; } + if (curlen < pktlen) { debug_info("received incomplete packet (%d of %d bytes)", curlen, pktlen); if (curlen > 0) { @@ -233,6 +234,7 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis free(content); return res; } + if ((pktlen > 8) && !memcmp(content, "bplist00", 8)) { plist_from_bin(content, pktlen, plist); } else if ((pktlen > 5) && !memcmp(content, "<?xml", 5)) { @@ -246,15 +248,17 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis debug_info("WARNING: received unexpected non-plist content"); debug_buffer(content, pktlen); } + if (*plist) { debug_plist(*plist); res = PROPERTY_LIST_SERVICE_E_SUCCESS; } else { res = PROPERTY_LIST_SERVICE_E_PLIST_ERROR; } + free(content); content = NULL; - + return res; } |