diff options
| author | 2013-03-14 03:09:14 +0100 | |
|---|---|---|
| committer | 2013-03-14 03:09:14 +0100 | |
| commit | 4222bc1b880d6535462e3b5ba5431809a3c5fddc (patch) | |
| tree | b664bbdfe96d162930b2719ec920cd149684b0ed /src/notification_proxy.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 'src/notification_proxy.c')
| -rw-r--r-- | src/notification_proxy.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/notification_proxy.c b/src/notification_proxy.c index 8fb9ad0..5b293f8 100644 --- a/src/notification_proxy.c +++ b/src/notification_proxy.c | |||
| @@ -108,12 +108,10 @@ static np_error_t np_error(property_list_service_error_t err) | |||
| 108 | */ | 108 | */ |
| 109 | np_error_t np_client_new(idevice_t device, lockdownd_service_descriptor_t service, np_client_t *client) | 109 | np_error_t np_client_new(idevice_t device, lockdownd_service_descriptor_t service, np_client_t *client) |
| 110 | { | 110 | { |
| 111 | if (!device) | ||
| 112 | return NP_E_INVALID_ARG; | ||
| 113 | |||
| 114 | property_list_service_client_t plistclient = NULL; | 111 | property_list_service_client_t plistclient = NULL; |
| 115 | if (property_list_service_client_new(device, service, &plistclient) != PROPERTY_LIST_SERVICE_E_SUCCESS) { | 112 | np_error_t err = np_error(property_list_service_client_new(device, service, &plistclient)); |
| 116 | return NP_E_CONN_FAILED; | 113 | if (err != NP_E_SUCCESS) { |
| 114 | return err; | ||
| 117 | } | 115 | } |
| 118 | 116 | ||
| 119 | np_client_t client_loc = (np_client_t) malloc(sizeof(struct np_client_private)); | 117 | np_client_t client_loc = (np_client_t) malloc(sizeof(struct np_client_private)); |
