From 707565701559d301b9336c45b555dcb481089f21 Mon Sep 17 00:00:00 2001 From: Shazron Abdullah Date: Thu, 13 Nov 2014 22:57:58 -0800 Subject: [PATCH] Fixes phonegap/ios-deploy#74 - SIGSEGV-ed while listing the sandbox of an application on iOS8 --- ios-deploy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ios-deploy.c b/ios-deploy.c index e78d674..342fb15 100644 --- a/ios-deploy.c +++ b/ios-deploy.c @@ -1163,7 +1163,12 @@ void read_dir(service_conn_t afcFd, afc_connection* afc_conn_p, const char* dir, char *key, *val; int not_dir = 0; - AFCFileInfoOpen(afc_conn_p, dir, &afc_dict_p); + unsigned int code = AFCFileInfoOpen(afc_conn_p, dir, &afc_dict_p); + if (code != 0) { + // there was a problem reading or opening the file to get info on it, abort + return; + } + while((AFCKeyValueRead(afc_dict_p,&key,&val) == 0) && key && val) { if (strcmp(key,"st_ifmt")==0) { not_dir = strcmp(val,"S_IFDIR");