diff options
author | Nikias Bassen | 2013-03-14 03:09:14 +0100 |
---|---|---|
committer | Nikias Bassen | 2013-03-14 03:09:14 +0100 |
commit | 4222bc1b880d6535462e3b5ba5431809a3c5fddc (patch) | |
tree | b664bbdfe96d162930b2719ec920cd149684b0ed /tools/ideviceimagemounter.c | |
parent | 23abc8303b8cad9251cd4ea4b5fa5af28e5f0b24 (diff) | |
download | libimobiledevice-4222bc1b880d6535462e3b5ba5431809a3c5fddc.tar.gz libimobiledevice-4222bc1b880d6535462e3b5ba5431809a3c5fddc.tar.bz2 |
global: make sure to check service before checking service->port to prevent crashes
Diffstat (limited to 'tools/ideviceimagemounter.c')
-rw-r--r-- | tools/ideviceimagemounter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/ideviceimagemounter.c b/tools/ideviceimagemounter.c index 57a2e27..e57d83a 100644 --- a/tools/ideviceimagemounter.c +++ b/tools/ideviceimagemounter.c @@ -305,7 +305,7 @@ int main(int argc, char **argv) lockdownd_start_service(lckd, "com.apple.mobile.mobile_image_mounter", &service); - if (service->port == 0) { + if (!service || service->port == 0) { printf("ERROR: Could not start mobile_image_mounter service!\n"); goto leave; } @@ -323,7 +323,7 @@ int main(int argc, char **argv) if (!list_mode) { struct stat fst; if ((lockdownd_start_service(lckd, "com.apple.afc", &service) != - LOCKDOWN_E_SUCCESS) || !service->port) { + LOCKDOWN_E_SUCCESS) || !service || !service->port) { fprintf(stderr, "Could not start com.apple.afc!\n"); goto leave; } |