summaryrefslogtreecommitdiffstats
path: root/src/mobilebackup.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-03-14 03:09:14 +0100
committerGravatar Nikias Bassen2013-03-14 03:09:14 +0100
commit4222bc1b880d6535462e3b5ba5431809a3c5fddc (patch)
treeb664bbdfe96d162930b2719ec920cd149684b0ed /src/mobilebackup.c
parent23abc8303b8cad9251cd4ea4b5fa5af28e5f0b24 (diff)
downloadlibimobiledevice-4222bc1b880d6535462e3b5ba5431809a3c5fddc.tar.gz
libimobiledevice-4222bc1b880d6535462e3b5ba5431809a3c5fddc.tar.bz2
global: make sure to check service before checking service->port to prevent crashes
Diffstat (limited to 'src/mobilebackup.c')
-rw-r--r--src/mobilebackup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mobilebackup.c b/src/mobilebackup.c
index ab4dec0..aae4b06 100644
--- a/src/mobilebackup.c
+++ b/src/mobilebackup.c
@@ -72,10 +72,9 @@ static mobilebackup_error_t mobilebackup_error(device_link_service_error_t err)
* or more parameters are invalid, or DEVICE_LINK_SERVICE_E_BAD_VERSION if
* the mobilebackup version on the device is newer.
*/
-mobilebackup_error_t mobilebackup_client_new(idevice_t device, lockdownd_service_descriptor_t service,
- mobilebackup_client_t * client)
+mobilebackup_error_t mobilebackup_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobilebackup_client_t * client)
{
- if (!device || service->port == 0 || !client || *client)
+ if (!device || !service || service->port == 0 || !client || *client)
return MOBILEBACKUP_E_INVALID_ARG;
device_link_service_client_t dlclient = NULL;